Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote

Status
Not open for further replies.

Mikeesc

IS-IT--Management
Aug 20, 2007
5
BE
Hi,

Im trying to write a script where i put in a hostname and then he should return me the serial number of the pc

strComputer = inputbox("machine name to query")
strNamespace = "root\cimv2"
strUser = "Admin"
strPassword = "password"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colBIOS = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
For each objBIOS in colBIOS
Wscript.Echo "Serial Number: " & objBIOS.SerialNumber
Next


but everytime i get an acces denief (users are not admin on there profile) thats why i included the credentials.


whats wrong ??

thx,
 
thats why i included the credentials
You never use strUser nor strPassword ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top