Am running my below comand line in my script.ps1 - to find the disk space of the remote machines (listed in servers.txt in my current folder)
Get-WmiObject Win32_LogicalDisk -filter "DriveType=3" -computer (Get-Content .\Servers.txt) | Select SystemName,DeviceID,VolumeName,@{Name="Size(GB)";Expression={"{0:N1}" -f($_.size/1gb)}},@{Name="FreeSpace(GB)";Expression={"{0:N1}" -f($_.freespace/1gb)}} | Out-GridView
Query 1:
I get the below error:
Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
I seached for the other blogs, i could find the solution like to enable Remote Desktop etc .. etc ..
Am not able to find the solution.
Query 2:
Actually i dont want to get the full space of the remote machine only a particluar folder.
\\RemoteMachineName\MyFolderName
If i give \\RemoteMachineName\MyFolderName in Servers.txt, the script throws error. it can only take the value "RemoteMachineName"
please help me out with getting the folder size for "MyFolderName"
Thanks in Advance.