

(strComputer, strNamespace, strUser, strPassword) Set objWMIService = objwbemLocator.ConnectServer _ Set objWbemLocator = CreateObject(“WbemScripting.SWbemLocator”) But chalking this up to synergy sounded much better than chalking it up to lethargy!Īs we noted in the weekly puzzle, you can use code similar to this snippet to run a script under alternate user credentials, provided that the script is running against a remote computer: strComputer = “atl-fs-01”
#Using script studio how to#
Our suggestion: read today’s Hey, Scripting Guy! column and learn how to run a script using the RunAs command.Ĭoincidence? No, laziness: we actually received this question several months ago, and we’re only just now getting around to answering it. In our answer we discussed the problems involved in getting WMI to run under alternate credentials when the script needs to run against the local computer.

For example, today we published the answer to a scripting puzzle that dealt with the issue of trying to run scripts under alternate credentials. Synergy is important in the scripting world as well. Coincidence? No, synergy, defined as “…the phenomenon in which two or more discrete influences or agents acting together create an effect greater than the sum of the effects each is able to create independently.” If there’s something more exciting than two or more discrete influences or agents acting together to create an effect greater than the sum of the effects each is able to create independently, well, we’d like to see it. For example, after The Mighty Ducks became a hit movie the Disney Company went out and bought themselves an NHL hockey team, renaming it the Anaheim Mighty Ducks. You know, in the business world one of the hot topics these days is synergy. Hey, Scripting Guy! How can I use the RunAs command to run a script under alternate user credentials?
