powershell bytespercluster
powershell bytespercluster
############################
# Script Function: This sample Windows powershell script calculates free disk
spaces
# in multiple servers and emails copy of csv report.
# Author: Victor Ashiedu
# Date: 16/05/2014
# Website: http://www.iTechguides.com
# -----------------------------------------------------------------------------
############################
$OldReports = (Get-Date).AddDays(-7)
#edit the line below to the location you store your disk reports# It might also
#be stored on a local file system for example, D:\ServerStorageReport\DiskReport
Get-ChildItem D:\CheckFreeSpace.v3\*.* | `
Where-Object { $_.LastWriteTime -le $OldReports} | `
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
#$RunAccount = get-Credential
#the disk $DiskReport variable checks all servers returned by the $File variable
(line 37)
#create reports
$DiskReport |
##Important note#