July 7, 2014 at 7:43 pm
Hi I have a scenario where in i need to get disks infomation of 100+ remote servers using powershell script. I have below script which only giving the disk information which are online.
Get-WmiObject win32_logicaldisk -computername MyServerName1,MyServerName2 | Where-Object { $_.DriveType -eq 3 } | Select-Object SystemName,DeviceID,VolumeName,FreeSpace,Size | Export-Csv C:\MyDiskSpace.Csv
I need to get he information for the disks that includes the disks that are offline as well.
Please help.
July 8, 2014 at 6:38 am
This uses DiskPart.exe, which may give the information you need - I tried this in powershell and it did tell me the online/offline status of local disks. Not sure how to make it work on remote servers
"List Disk" | DiskPart
output
Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: ACA-M264
DISKPART>
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 465 GB 0 B
Disk 1 Online 29 GB 0 B
Disk 2 Offline 135 GB 1024 KB
DISKPART>
output from a windows 7 machine.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy