How can I do an impersonation in PowerShell? I can use advapi32.dll LogonUser, but maybe there is a simpler solution?
A:
There was a similar discussion on this topic a long time ago (well, relative to how long SO exits).
Long story short, use LogonUser, psexec, or PowerShell command that have Identity parameter.
Shay Erlichmen
2009-04-12 21:21:10
A:
You can use the above mentioned methods, and specifically, the PowerShell Get-Credential method worked for me. Also check the Secure-String methods to enable you to get the credential information and use the password information.
Pete Skelly
2009-04-13 23:27:13