views:

830

answers:

2

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
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