Ask @SimpleSi this kind of setup is his speciality
hi there i have a group of users that use laptops and are not part of a domain. they all have usernames on the domain. and what i need to be able to map there mydocs folder from the server but the script ideally needs to prompt for a username and then use that in the mapping....
net use T: "\\Server\*there username*$
to map the hidden share.
in a perfect world i would also like the script to be able to connect to 2 other network shares and a printer too.
(Not tested, but should do it)Code:strInput = InputBox( "Enter your name now!!!", "DriveMapping") dim oShell Set oShell = CreateObject("WScript.Shell") oShell.Run "NET USE X: \\server\" & strInput & "$"
But aren't you going to need username/passwords etc to connect to the domain, or is it open?
Yes i am going to need a username and password to connect to the server. so is there a way of adding that in the code? i can setup a user with access to all home folders.
just tried that script and it working if i have connected to the server with a username and password. but another question i have two server and have different users on each is there any way of saying if that share is not on server1 look at server 2 if that makes any sense?
but thanks alot for the script
Haven't tested this, but if you were to add & "/user:domainname\" & strInput to the end of the last line, (replace domainname with your domain of course), that should then ask for the password when it shells out to map the drive.
on end of code like this:Code:/user:domain\username password
Not tested though,Code:strInput = InputBox( "Enter your name now!!!", "DriveMapping") dim oShell Set oShell = CreateObject("WScript.Shell") oShell.Run "NET USE X: \\server\" & strInput & "$ /user:domain\username password"
i must be doing somthing wrong as its not working for me
What bit? Any errors?
nope not errors the script works without the "$ /user:domain\username password"
am i right in thinking it would be /user:mydomain\myusername mypassword"
right i've got that working. it was because my test machine was on the domain and therefore had the authenitcation.
so is it possible to have it look at two servers and a way of telling it if that share is not on server1 look at server 2 if that makes any sense?
Maybe instead of shelling out to a one-line net use command, shell to a three-line .cmd file that picks up the username, password and sharename as parameters, tries to use them to map to the share on server1, exits if errorlevel is 0, otherwise maps to server2...
right and how could i do that?
so is it not possible to use the script that "steve21" gave me and add something to it?
There are currently 1 users browsing this thread. (0 members and 1 guests)