wls3
asked on
How can I impersonate an account in vbscript
I am trying to configure some VBScripts to run within a third-party system. I need to impersonate a domain user from within the script. How can this be done? Normally the WMI classes allow impersonate, but, I am trying to use the Scripting.FileSystemObject .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Rob. I had not had to dig into those NetworkDrive methods before. I am checking them out on MSDN now. Appreciate the pointer.
Thanks for the grade, you'll also want to remove the mapping again after you use the FSO methods.
Rob.
Rob.
ASKER
Appreciate the follow up comment. I had seen some other folks suggesting something along these lines, but, I didn't know this was essentially creating a pipe. From what I had seen I just assumed the close was to dispose of the object, not a pipe. Again, thanks.
If you trigger it remotely you can use 'psexec.exe' by Sysinternals (Microsoft).
If you need to trigger only a portion of the script as userA while the main script runs as userB you can allways re-call a portion of the script through WshShell.Run "Runas.exe <args> C:\Scripts\PortionOfMainSc
-Daniel