Cmdlet Suggestion: A cmdlet to impersonate windows user

Topics: Developer Forum
Sep 20, 2006 at 12:17 AM
I would like to suggest for a cmdlet for impersonating windows user.

Suppose that if you set-location to a UNC path(e.g., cd \\Server\Share), unless you are already identified,(through CredUI), you cannot set-location into network share or other network computers.

So what I have in mind is something like(I am not sure if I have used "Impersonate" in this context correctly or not... please correct me if I am wrong),
"Impersonate-WindowsUser -ComputerName <IP or Host name> -User <user name> -Password <password>"

So after
PS> Impersonate-WindowsUser -Computer -User:Administrator -P:password
One can set-location to "" like the following
PS> cd \\\SharedFolder

-- Sung Kim

Sep 20, 2006 at 1:47 AM
Interesting idea. I'll try to look into it. I haven't done much with impersonation of other security principals so I don't know if this is possible or not.
Sep 20, 2006 at 4:40 AM
Thank you, Keith for having an interest in the idea.
By the way, here are quick links to implementing impersonation.

Microsoft KB article
  •;en-us;Q306158 articles written based on MS KB article above
Dec 20, 2006 at 2:16 PM
Impersonation is a process where a server acts on behalf of its client (using provided credentials). This is not the case, you are proposing a command which will cache your credentials using the WNetAddConnection3 function ( )
Dec 26, 2006 at 2:18 AM
This discussion has been copied to Work Item 6794. You may wish to continue further discussion there.