I've got a authentication-related script question. If anyone can help out or
point me toward someone/something with a clue or hint I would be really
really appreciative.
Basically my issue is I want to run a script (vbscript) that reads the
registry on a remote win2003 server using different NT Domain credentials
from my own. I have the credentials (pulled from a database) and I can
connect to the remote computer and make wmi calls (such as
win32_ComputerSysem) using them via SWbemLocator:
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set WmiObjSet = objSWbemLocator.ConnectServer(strComputer, _
"root\CIMV2", _
strUser, _
strPassword, _
"MS_409", _
"NTLMDomain:" + strDomain)
But that won't work for the registry calls, because I need to use
"winmgmts:" and I can't find any docs on how to use it with different
credentials.
Set objReg = Getobject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer _
& "\root\default:stdregprov")
All I have been able to find on MS site is information about the
"impersonationLevel" in the call and using kerberos versus ntlm but nothing
about how to actually validate as a different domain user.
I did find the following info on page:
http://msdn2.microsoft.com/en-us/library/aa389292.aspx
"You cannot specify a password in a WMI moniker string. If you must change
the password (strPassword parameter) or the type of authentication
(strAuthority parameter) when connecting to WMI, then call
SWbemLocator.ConnectServer."
However I have yet to find any info on a script that reads a registry key
without using "winmgmts"
Can anyone help me?
Mark Butler
Bookmarks