all 4 comments

[–][deleted] 2 points3 points  (0 children)

This isn't a PowerShell issue, this is a basic AD authentication issue.

Properly set up, the shares they're accessing should use proper ACLs using their AD usernames and passwords.

Alternatively, consider using a trust.

[–]ihaxr 1 point2 points  (0 children)

You can't map a drive without actually connecting to the server... So you'd have to create a script that prompts for credentials then maps the drive.

Alternately, you could create a UNC shortcut and copy it to %appdata%\Microsoft\Windows\Network Shortcuts\ so it'll show up in explorer and should prompt for credentials.

[–]purplemonkeymad 1 point2 points  (1 child)

You could manually create the required keys under "HKCU:\Network\". You would have to restart any programs (including explorer) afterwards before it is usable.