I am trying to map a Sharepoint location to a drive letter using the net use command.

Our pc is in one domain (CD) and Sharepoint is in another domain (postgbr).

I am running cmd.exe elevated with a Domain Admin account (my account) and trying to map the drive on another users laptop. This needs to be elevated because otherwise the user received an error - System error 5 access is denied.

I know that I should specify the user in the net use command as follows:

net use l: http://sharepoint/address /user:cd\example_user

This is used so that the mapping is applied to the laptop users account instead of my Domain Admin account that was used to elevate cmd. In doing this, we are then prompted for the users password to access Sharepoint but there is no option that I can find to specify the different user account for Sharepoint - it always tries to use the user account in the domain the mapping is being applied to:

Enter the password for cd\kevinh to connect to 'sharepointportal/address/':

Neither the Sharepoint password for kevinh or the CD domain password are accepted here.

I hope that makes sense, I did struggle to explain it clearly so please let me know if any clarification is required.

Is there a way to achieve this mapping to a driver letter via net use command, or any other alternatives?

Thank you, James

  • From a bit of research, you're not the only one. This is likely a limitation of the WebDAV client in Windows. I would suggest using alternate methods to work with SharePoint, such as file synchronization or simply the web UI.
    – user6024
    Jun 9, 2016 at 16:01
  • Thanks for confirming this Trevor, I feared as much after reviewing the parameters for the net use command. Unfortunately we will be unable to use macros referring to mapped drives with the workarounds that you mention but I shall propose those as our alternate options. Jun 10, 2016 at 15:18

1 Answer 1


I have found that it is necessary to add the username and password to Credential Manager in order for this to work. I navigated to the Sharepoint web address and was prompted for username and password, make sure to check the box to remember the credentials.

Then, when I run the net use command, I am not prompted for username and password at all and receive the message 'The command completed successfully'

This will enable the net use command to map the drive on a computer in one domain whilst using the stored credentials for another domain and user account.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.