You are running this file on the actual server right?
Might be easier just to run "Solarwinds NCM Diagnostics" on your NPM/NCM server by going to Start, All Programs, Solarwinds Network Configuration Manager, and then selecting Solarwinds NCM Diagnostics.