views:

22

answers:

2

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 risks).

A: 

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

rerun
A: 

Joel "Jaykul" Bennett created some PowerShell functions for impersonating network credentials. You don't even need to store the credentials in the script, there are ways to store credential objects.

JasonMArcher