Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WMI with Alternate Credentials

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3130
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WMI with Alternate Credentials
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 WMI with Alternate Credentials - 5/26/2005 5:31:19 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
Any ideas why this script is failing on the GetObject?


Const WbemAuthenticationLevelPktPrivacy = 6

strComputer = "mlnusa-share"
strNamespace = "root\cimv2"
strUser = "user"
strPassword = "password"

Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objwbemLocator.ConnectServer _
(strComputer, strNamespace, strUser, strPassword)
objWMIService.Security_.authenticationLevel = WbemAuthenticationLevelPktPrivacy

Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errReturn = objWMIService.Create _
("cmd.exe /c md \\share\users\testing", Null, Null, intProcessID)
 
 
Post #: 1
 
 Re: WMI with Alternate Credentials - 5/26/2005 8:39:03 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
i think you need to add the impersonate

winmgmts:{impersonationLevel=impersonate}

(in reply to esnmb)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WMI with Alternate Credentials Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts