Hello Friends,
Could you please help me with the below script?
Below script works great but we have multiple domains no trust so i want to pass different credentials for different domnains.
foreach ($Server in (Get-Content C:\psfiles\QAEntservers.txt)){Get-WmiObject Win32_Volume -ComputerName $Server | Where {$_.DriveLetter -eq $null} | Select @{Expression={$Server};label="ServerName"},SystemName,label,@{Expression={$_.Capacity /1Gb -as [int]};Label="Total Size(GB)"},@{Expression={($_.Capacity /1Gb -as [int]) - ($_.Freespace/ 1Gb -as [int])};Label="InUse Size (GB)"},@{Expression={$_.Freespace / 1Gb -as [int]};Label="FreeSize (GB)"},@{Expression={[math]::round(((($_.Freespace /1Gb) / ($_.Capacity / 1Gb))*100),0)};Label="FreeSpace (%)"},@{Expression={$(Get-Date -format 'd')};Label="Report Date"} | Export-csv "C:\Psfiles\getqaServerspace.csv" -NoTypeInformation}
Appreciate your help!