Hello. Looking for some assistance on setting up my Win32 perl script that does WMI Query, so that is runs as a specified user (not the user who will fire off the script). Wrote a very crude VBScript program a while ago that worked (but need to re-write in perl) and it did the following... Setup variables for the Admin user I intended to use, for their username and password, then fed the WMI query through the following VBScript function (worked fine):
Working VBScript Method: Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = objSWbemLocator.ConnectServer _ (sComputer, "root\cimv2", strUser, strPassword) (Where "sComputer", "strUser" and "strPassword" were the string variables containing the computer name, username and password) Can't seem to find the same functionality in perl... Tried to append the same type of variables to my (working) call: my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$sComputer\\root\\CIMV2") or warn "WMI connection failed: $!\n"; Changing it to: my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$sComputer\\root\\CIMV2\\$strUser\\$strPassword") or warn "WMI connection failed: $!\n"; but does not allow. Has anyone done this? Need script to run as specified user. - Joe Pantera, Admin / DBA -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joseph F. Pantera System, Database & Network Administrator Gibson Dunn & Crutcher LLP work mail: [EMAIL PROTECTED] home mail: [EMAIL PROTECTED] phone: (213) 229-7673 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- _______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs