Thursday, November 13, 2008
Tuesday, November 11, 2008
Using the net use command with username and password
This has been giving me some trouble lately so I decided to write a blog about it just in case somebody else is having the same the trouble.
I usually use the command like this to handle mappings:
Net use [drive letter]: \\servername\directory
I would type this into notepad save as a batch file(.bat) extension
Save it in the sysvol fold in the windows directory on the c: on my active director server and set group policy to use it as a logon script.
That process is very simple and works like a charm but then a new challenge came up. My computers were on a win2000 domain and I decided to upgrade to win server 2003 since I was sure what the outcome would b I upgraded a few department first so I ended up with 2 domains and now I have to make directories on one domain accessible to the other.
I notice that if I format my script as I did in the example above, the computer would prompt me for a user name and password but I don’t what my users to have to go through that and so it was that I decided to search the net to find out the appropriate format for a script that would allow my users to authenticate automatically to the foreign directory on logon.
In the process I discovered this:
Net use [drive letter]: \\servername\directory /user:domain\user
Where user is the user’s username as listed in the domain’s active directory.
Now that would pause the batch file and allow the user to put in the password and the mapping would be created as long as you typed in the correct password for the user account.
If that suits your purpose you can stop here. But it doesn’t suit mind so I am still building brain cells.
The command format I found on the net was simple
Net use [drive letter]: \\servername\directory /user:domain\user password
Where password is the password for the user account as listed in the active directory
Now when that doesn’t work you could imagine the frustration, after many trying and testing I decided to remove the spaces from my password. The angel dust fell on the keyboard and the computer was charmed.
So remember if you a struggling with this command make sure there are no spaces in you user names and passwords even you directory names
I usually use the command like this to handle mappings:
Net use [drive letter]: \\servername\directory
I would type this into notepad save as a batch file(.bat) extension
Save it in the sysvol fold in the windows directory on the c: on my active director server and set group policy to use it as a logon script.
That process is very simple and works like a charm but then a new challenge came up. My computers were on a win2000 domain and I decided to upgrade to win server 2003 since I was sure what the outcome would b I upgraded a few department first so I ended up with 2 domains and now I have to make directories on one domain accessible to the other.
I notice that if I format my script as I did in the example above, the computer would prompt me for a user name and password but I don’t what my users to have to go through that and so it was that I decided to search the net to find out the appropriate format for a script that would allow my users to authenticate automatically to the foreign directory on logon.
In the process I discovered this:
Net use [drive letter]: \\servername\directory /user:domain\user
Where user is the user’s username as listed in the domain’s active directory.
Now that would pause the batch file and allow the user to put in the password and the mapping would be created as long as you typed in the correct password for the user account.
If that suits your purpose you can stop here. But it doesn’t suit mind so I am still building brain cells.
The command format I found on the net was simple
Net use [drive letter]: \\servername\directory /user:domain\user password
Where password is the password for the user account as listed in the active directory
Now when that doesn’t work you could imagine the frustration, after many trying and testing I decided to remove the spaces from my password. The angel dust fell on the keyboard and the computer was charmed.
So remember if you a struggling with this command make sure there are no spaces in you user names and passwords even you directory names
Subscribe to:
Posts (Atom)
