Attempting to map network drive with different username / password

413315 pts.
Tags:
Network Drive
Windows PowerShell
Now, I have the following PowerShell script that allows my local machine to automatically map network drives.
$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("p:", "\papaboxfiles");

$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("q:", "\quebecboxfiles");

## problem -- this one does not work because my username/password
## is different on romeobox
$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("r:", "\romeoboxfiles");
Now my question is how can I modify it that allows me to connect to Romeobox, even though the password / username is different than the other two boxes?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: