Nozza Posted May 3, 2009 Posted May 3, 2009 I'm messing about with a virtual network I've created to learn my MCSE exams on. I want to automate network drive mapping on the domain workstations. I can do this from the workstation using the dialogue in My Computer but can't seem to get the net use command to do the same thing - I need to get that command line right so I can write the script. My domain is headquarters.nozzacorp and the server share is Share Folders on Server1 why won't net use z: \\server1\share folders work?
rh91uk Posted May 3, 2009 Posted May 3, 2009 Whats is the error you are getting, then we could help! Check Z is not used anywhere else tho!
FN-GM Posted May 3, 2009 Posted May 3, 2009 I think i know why. If the path has a space in it you will need to put " in. for example net use z: \\server\shared foldder - wont work net use z: "\\server\shared folder" - will work net use z: \\server\sharedfoldder - will work net use z: "\\server\sharedfoldder" - will work
Nozza Posted May 3, 2009 Author Posted May 3, 2009 Sorry! "unknown user name or bad password" I'm logged on the workstation (well to the domain) as a domain admin account I created.
rh91uk Posted May 3, 2009 Posted May 3, 2009 Yeah - FN GM's suggestion is the correct one. Just tried it myself! Did think that in the beginning lol but wanted to see the error msg just in case lol!
EduTech Posted May 3, 2009 Posted May 3, 2009 (edited) If it is bad username and password, try clicking "Conntec using a different username and password" and then type in administrator credentials and then see if that connects. [scrap that forgot it was a script] If FN's Suggestion dont work Edited May 3, 2009 by EduTech
Nozza Posted May 3, 2009 Author Posted May 3, 2009 Heh yeah it was the quotes thing. I don't remember reading that in the book. It didn't appear to work initially but I also had to drop the \ off the end of the share name. Thanks
john Posted May 4, 2009 Posted May 4, 2009 Also don't use Z drive for mapping drives as thats the temp letter windows uses to map when logging on. Found that out to my cost a long while ago it doesn't like Z drives (this was back when 2003 and XP were new out so may be fixed by now) but when you logon windows maps a Z drive to the sysvol folder for pulling and running scripts, files etc and then disconnects it before you actually get to windows to see it.
FN-GM Posted May 4, 2009 Posted May 4, 2009 Also don't use Z drive for mapping drives as thats the temp letter windows uses to map when logging on. Found that out to my cost a long while ago it doesn't like Z drives (this was back when 2003 and XP were new out so may be fixed by now) but when you logon windows maps a Z drive to the sysvol folder for pulling and running scripts, files etc and then disconnects it before you actually get to windows to see it. We use Z drive without any problems, might have slightly changed.
m25man Posted May 4, 2009 Posted May 4, 2009 why won't net use z: \\server1\share folders work? Nozza, You correctly diagnosed that the "\\server1\share folders" was your mistake, but you may also want to add to your diagnostics the use of the IP address instead of the netbios name. Eg \\server1\sharename = \\192.168.xx.xx\sharename Keberos authentication and the SPN attributes of AD can run into difficulties when trying to connect to available shares on your AD hosts from non AD aware hosts or vice versa. You may find that a connect can be made using IP but not when using Netbios share names! I recently uncovered this when trying to access an AD resource from a workgroup machine, the share was visible when browsing the lan but access was denied when trying to connect. A packet capture revealed that there was an SPN mismatch. ADUC had the target server object still registered as "Server1" because the machine account had not been deleted when the machine was changed back to a workgroup name of "server1" Only after finding the orphaned object in AD and deleting the defective machine account/SPN did the share resume correctly!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now