/netonly Use the credentials for remote access only./savecred Use credentials previously saved by the user.
This wasn't a plz-give-me-teh-codez answer :-S By the way, I should add the OP might want some more elaborate command like No, this answer is technically incorrect. - Shows this help -wait - Waits until prog terminates -k - Starts the the %COMSPEC% environment variable value and executes prog in it (CMD. EXE, etc.) prog - The program to execute args - Optional command line arguments to prog I think I have a solution to the password problem. It asks for the password once, and than never asks for it again.
Beginning in Windows Power Shell 3.0, it is valid in all scripts.
Invocation Info object representing the context the current code was called in.
You might find this helpful for yourself, or run it from a batch file (although the password will be in clear text).
Another alternative is to hardcode the command, username and password in the script, then use the Script Encoder (download from to encode it.