powershell
Eject a CD/DVD Drive with Powershell
Submitted by justin on Fri, 02/11/2011 - 09:05Here's a quick Powershell script to eject all CD/DVD drives on a computer. This uses the WMPlayer COM object.
$wm = New-Object -ComObject "WMPlayer.ocx"$drives = $wm.cdromCollectionfor($i = 0; $i -lt $drives.Count; $i++){$drives.Item($i).Eject()}
Feedback is always welcome. Enjoy!
Change DNS Servers Remotely with Powershell
Submitted by justin on Wed, 01/19/2011 - 08:46At some point most admins will need to change a DNS server (or two) on their network. This is an easy change for DHCP clients, but can be a real pain for statically assigned clients. Below is a simple Powershell script that runs through a list a computer names and updates the DNS servers on the clients.