This script using Powershell, takes a list of SQL Servers , iterates through the list and returns the results from the procedure: master.dbo.xp_fixeddrives.
Run this script as a standalone script or as part of a more comprehensive health monitoring snapshot
Depending on your security architecture, there may be a requirement to adjust the security method used to authenticate on the SQL Server
############START################# foreach ($svr in get-content "C:\MySQLServers.txt"){ $dt = new-object "System.Data.DataTable" $cn = new-object System.Data.SqlClient.SqlConnection > "server=$svr;database=master;Integrated Security=sspi" $cn.Open() $sql = $cn.CreateCommand() $svr $sql.CommandText = "EXEC master.dbo.xp_fixeddrives" $rdr = $sql.ExecuteReader() $dt.Load($rdr) $cn.Close() $dt | Format-Table -autosize } ##############FINISH########################
Republished from http://www.sqlserver-dba.com.