Archive for the 'Admin' Category

Disk information via PowerShell & WMI

December 12, 2008

Sorry for taking so much time off in between posts. Lot’s of stuff happening. So, without further waiting, here we go – the long-promised Disk Info via PowerShell & WMI.
Note, there is a filter being applied to Get-WMIObject ["Drive Type = 3"] is a local disk drive.

##Create ServerList.txt file:
sqlcmd /Lc > F:/temp/ServerList.txt

#Populate $Server_List
$Server_List [...]

Powershell – Read list & get service information.

May 23, 2008

This is a PowerShell script that will use SQLCMD to generate a list of SQL Servers on your network, piping the reults into a file.  A “classic” database connection is made and the list is processed using a PSH foreach loop calling Get-WMI in order to retrieve SQL Service information via WMI. As the service information is [...]