windowscommand-promptwebdavnetwork-sharenet-use

NET USE command doesn't authenticate when credentials are passed as parameters


I'm trying to connect to a remote WebDAV server by mapping it as a drive using NET USE command.

NET USE * <domain> /user:<username> <password>

Executing this command gives the following error:

System error 1244 has occurred.

The operation being requested was not performed because the user has not been authenticated.

But when I execute just

NET USE * <domain>

It asks for username and then password.

Enter the user name for <domain>: 
Enter the password for <domain>:

Upon entering this I can now connect to the remote location and the drive is mapped.

What is causing this error? And how can I resolve it?

These commands will be automated, so I would like to pass the credentials as parameters instead of entering when prompted.


Solution

  • Credits to user Larryc for his answer on Server Fault site.

    I wasn't including user domain name in the username parameter of the command. I included it and it worked.

    NET USE * <domain> /user:<user_domain>\<username> <password>