The Need:
When patching my servers I occasionally have an issue that I reboot a server that has a CD left in the drive and the server doesn't come back up after the reboot. I quickly wrote this script to check through a list of servers for CD Drive that have disks inserted.
The Script:
#This script checks a list of remote server to see if a CD is loaded.
$servers = Get-Content c:\servers.txt
function Get-RemoteCD
{
Foreach ($Server in ($Servers))
{
gwmi win32_cdromdrive -comp $Server | select SystemName,MediaLoaded,VolumeName | ft -auto
}}
Get-RemoteCD
Monday, 30 March 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment