Impersonation in Powershell - Access remote file
I need to read a file on a remote server, however I dont have permissions to do so. If I use another account with elevated rights, I can. I would like to run the script from anywhere with the credentials built into the script (accepting the ri开发者_开发技巧sks).
If you just need access to the file you can establish credentials an any manner. If you don't have a drive mapped you can use the net use command or the Get-Credential commandlet. Once you establish access with a valid user name you should be fine unless you need some type of elevate privileges on your box
精彩评论