northeast_technician Posted January 29, 2018 Posted January 29, 2018 looking at running a script to add a network share on the admin machines in school to a share on the curriculum server. Tried net use z: \\networkshare /USER:domain\username password /PERSISTENT:NO but doesnt seam to work
deebee Posted January 29, 2018 Posted January 29, 2018 Does manually mapping the drive from 'Map network drive' in explorer work? Are these all on the same domain or is there a separate Admin and Curric domain set up?
JackCPickup Posted January 29, 2018 Posted January 29, 2018 Does the authenticating account have appropriate permissions? Can you browse to the share with the authenticating account? Flat network? Multiple domains?
northeast_technician Posted January 29, 2018 Author Posted January 29, 2018 yes set the account with admin permissions, it does connect when adding manually but the admin machine policy disconnects on startup so i want the script to re run on login they are 2 separate domains admin / curric
deebee Posted January 29, 2018 Posted January 29, 2018 Does the script work if you manually double click on it on the client? Is it in the 'logon' scripts and not 'startup'? Is the script stored locally or on a remote share? Is there a domain trust in place? Could you use GPP (group policy preferences) to map the drive instead?
northeast_technician Posted January 29, 2018 Author Posted January 29, 2018 i cant as i am mapping from a none domain machine so dont have control over the gpp
deebee Posted January 29, 2018 Posted January 29, 2018 i cant as i am mapping from a none domain machine so dont have control over the gpp OK GPP is out Either way the script should be able to do the trick. Does it work when double clicking it on the client?
northeast_technician Posted January 29, 2018 Author Posted January 29, 2018 No that’s where I was wondering if I had done something wrong
deebee Posted January 29, 2018 Posted January 29, 2018 No that’s where I was wondering if I had done something wrong Well I don't think I see anything wrong with your command line - does the command work if you paste it into a command prompt directly, outside the script?
northeast_technician Posted January 29, 2018 Author Posted January 29, 2018 Well I don't think I see anything wrong with your command line - does the command work if you paste it into a command prompt directly, outside the script? yes it does, just tried that but doesnt from script
JackCPickup Posted January 29, 2018 Posted January 29, 2018 If you put a PAUSE in the script below the command what do you get as an error?
deebee Posted January 29, 2018 Posted January 29, 2018 Are you using a trailing \ on the share? net use z: \\server\share\ /USER:domain\user PASSWORD If so try without the \ - \\server\share - seems silly but worth trying if you have one. I've seen that cause issues before I believe.
Katy Posted January 29, 2018 Posted January 29, 2018 I've found with scripts that work in command line but not when clicked/ran - it still thinks the drive is mapped (but errors when you try to change to it, and doesn't show in explorer), so you have to do a "net use z: /del" before mapping it again in the script.
Knil92 Posted February 8, 2018 Posted February 8, 2018 (edited) you could try; net use z: "\ "\\networkshare" /USER:domain\username password /PERSISTENT:NO I had an issue making a schedule task from command line before and it was to do with the file path and adding in "" before the file path and a " at the end resolved it. EDIT: its not letting me add in the "\ " without a space so take the space out Edited February 8, 2018 by Knil92
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