PowerShell – Find Disk Drive Details of local or remote Server

Name of the Function : Get-DiskDriveDetails

Input Parameter : ServerName

Ouptut : Grid view, you can sort and force condition on specific output column

Function call : Get-DiskDriveDetails HQDB001

In this case HQDB001 is Name of the Server


Function Get-DiskDriveDetails([String]$server)
Get-WMIObject Win32_LogicalDisk -filter “DriveType=3″ -computer $server| Select SystemName,DeviceID,VolumeName,@{Name=”Size(GB)”;Expression={[decimal](“{0:N3}” -f($_.size/1gb))}},@{Name=”Free Space(GB)”;Expression={[decimal](“{0:N1}” -f($_.freespace/1gb))}}|out-gridview


About Prashanth Jayaram

DB Technologist, Author, Blogger, Operations-Mgr at CTS, Automation Expert, Technet WIKI Ninja, MVB and Powershell Geek You can connect me via https://social.technet.microsoft.com/profile/prashanth jayaram/ http://www.sqlshack.com/author/prashanth/ https://www.tumblr.com/blog/prashantjayaram http://www.sqlservercentral.com/blogs/powersql-by-prashanth-jayaram/ http://www.toadworld.com/members/prashanthjayaram/ My Articles are published in following sites http://www.ssas-info.com/analysis-services-articles/ http://db-pub.com/ http://www.sswug.org/sswugresearch/community/
This entry was posted in PowerShell. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s