Really impressed with the PC Inventory script. The problem I'm having is with the WMISysInfo function. Works great on my pc with WMISysInfo(). If I try WMISysInfo($sComputer) I get "Error: unexpected command!" on whatever the next line is. I used WMIAuthentication to get credentials and tried WMISysInfo(@Host,$WMIAuth) but still got same error for the next line. If I just run WMISysInfo() it runs great. Any ideas what I'm doing wrong? I have made no changes to WMISysInfo but just in case I removed it from my script and re-copied it but still won't work. Created another script with just the WMI Authentication function and the WMISysInfo function
$Host = 'PANASONIC-PC' $WMIAuth = WMIAuthentication($Host,'user','password') $Up = WMISysInfo($Host,$WMIAuth) ? $Up[0]
Still no go.
|