Prev: Opening DLLs
Next: objExcel.ActiveWorkbook.SaveAs
From: Jo on 11 Jan 2010 11:18 Hi, Is there a way to run VBScript remotely with alternate credentials? Thank's for your help.
From: Richard Mueller [MVP] on 11 Jan 2010 13:38 "Jo" <j.tribaudini(a)gmail.com> wrote in message news:388913a5-40cd-4761-b722-0f4dfebf57da(a)21g2000yqj.googlegroups.com... > Hi, > > Is there a way to run VBScript remotely with alternate credentials? > > Thank's for your help. You can use the Win32_Process class of WMI to run an executable, including a script, remotely, as long as it runs silently with no user interaction. An example VBScript program is linked here: http://www.rlmueller.net/Deploy.htm But why use alternate credentials? Why not just logon as a user with the required credentials, then run the script remotely? Also, many things can be done remotely without using the Win32_Process class to have the program actually run on the remote computer. You can bind to the remote computer and modify many things from your computer. The only time the Win32_Process class is required is when the only option is to run the executable locally on the computer. For example, setup programs would require this. It might help if you let us know what you want to do on the remote computers. For alternate credentials you can use the OpenDSObject method. For example: ========= Const ADS_SECURE_AUTHENTICATION = 1 ' Specify object. strADsPath = LDAP://cn=RemoteComputer,ou=West,dc=MyDomain,dc=com ' Specify credentials. strUser = "administrator" strPassword = "xZy$321q!" Set objDSO = GetObject("LDAP://") Set objComputer = objDSO.GetDSObject("strADsPath, strUser, strPassword, ADS_SECURE_AUTHENTICATION) -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net --
|
Pages: 1 Prev: Opening DLLs Next: objExcel.ActiveWorkbook.SaveAs |