Eject a CD/DVD Drive with Powershell

Here'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.cdromCollection

for($i = 0; $i -lt $drives.Count; $i++)





Feedback is always welcome.  Enjoy!

Change DNS Servers Remotely with Powershell

At 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.


Netdiag [FATAL] Could not open file C:\WINDOWS\system32\config\netlogon.dns for reading.

When you run the netdiag command on a Windows Server 2003 server, you may encounter the following errors:

    [FATAL] Could not open file C:\WINDOWS\system32\config\netlogon.dns for reading.
    [FATAL] Could not open file C:\WINDOWS\system32\config\netlogon.dns for reading.
    [FATAL] No DNS servers have the DNS records for this DC registered.


This is because the 32-bit version of netdiag, while supported by Microsoft, isn't able to locate the DNS file in a 64-bit installat

Uninstall McAfee Agent & AntiVirus - Completely remove McAfee via command line/script

If you're like most admins out there, you've had a need to completely remove McAfee components whether it's troubleshooting or getting rid of the product.

McAfee is a stubborn product to remove.  They offer a tool to assist with removing their consumer products.  This won't work on managed installations (ePO) unfortunately.  So I've assembled a batch file to handle the dirty work.  As always, use at your own risk.


Indexing Adobe Arobat PDF files with SharePoint Server 2007

So you have a snazzy new SharePoint site?  It works wonderfully with Office documents.  Now you need to index all those PDF files that are floating around the office.  Fortunately, this is an easy fix.



  • Windows Server 2008 R2 Standard
  • Microsoft Office SharePoint Server (MOSS) 2007
  • Adobe IFilter 9.0 for 64-bit platforms - Download
  • Adobe Acrobat Reader (to view documents)
  • A GIF to use for the Acrob

DCOM 10016 Errors with SharePoint 2007 and Windows Server 2008 R2

It seems that by default SharePoint 2007 has some DCOM/IIS related issues on Windows Server 2008 R2.  I've run into this error multiple times on multiple servers:

EVENT ID: 10016
SOURCE: DistributedCOM
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID



How to connect to the WSUS database using SQL tools

On ocassion you may need to connect to the WSUS database.  There have been times where you run into consistency errors that need to be corrected using the SQL Management Studio.  Not a big deal if your database resides on a full blown SQL Server instance.  If you're using the Windows Internal database installation, its not quite as straightforward.

Here's how to connect:

Troubleshooting Team Foundation Server 2008

If you're reading this page chances are you've hit a roadbloack install Team Foundation Server. You're not alone. A quick search on MSDN will reveal a large number of unsolved questions. Fortunately, I've got a few answers. First off, the documentation is horrible. There are missing steps and incorrect information throughout. Add to that a setup experience akin to hugging a rabid bear and its no wonder people get upset.

Reinstall MDAC on Windows XP/2003

I recently came across a Windows Server 2003 box that was missing the SQL Server driver from the ODBC Administrator. After some research and trial & error I came across a really simple way to fully reinstall MDAC 2.8 SP1 on Windows. You can't simply download MDAC from the Microsoft site and install it since its part of the OS.

You will need your Windows CD (or at least access to the i386 directory) to complete this process.

Import an Excel Spreadsheet into SQL

When I started on this task, I thought it would a very simple thing to do. I mean its a similar concept for both; rows and columns. Well I spent two days banging my head on the desk before coming up with a solution.


Syndicate content