Monday, November 3, 2014

Give credentials from command line while accessing network resources or map network drive

You try to copy a folder from a network location :
robocopy -E \\computername\folder\ D:\  
 
and you receive :
Logon failure: unknown user name or bad password.
 
To fix it type first :  
net use \\computername\ipc$ password /USER:username
 
 
To map a network drive :
net use n: \\computername\sharedfolder password /user:username
 
 
If you receive : 
A specified logon session does not exist. it may already have been terminated.
 
This behavior occurs when the "Do not allow storage of credentials or 
.NET Passports for network authentication" Network access policy is 
enabled.
 
gpedit.msc
 Windows Settings -> Security Settings -> Local Policies -> Security Options
Network access: Do not allow storage of credentials or for network authentication  
Disable. 

No comments:

Post a Comment