atari37 Posted July 13, 2007 Posted July 13, 2007 Hi Guys,I need some help with mapping network drives via active directory.Basically I have two servers. Server one is my AD server and Server two is my file server. Server 2 has about 4 shared directories which are mounted as shared drives on that server. These shared drives have group permissions, ie, group A and group B, which also exists in AD under groups. I need to find a script that will allow me to mount these drives automatically when a user logs on. In other words, if user1 belongs to group A, then I would like group A drives to be auto-mounted once the user logs in. I had a login script that accomplished this for 1 drive and one group by using the GPO login script under Group Policy ->Windows settings ->Login script but this same script is not working for multiple shared drives. Anyone have a script I can edit or can someone direct me to a script I can use to test out my scenario? Thanks in advance.
chilifrei64 Posted July 13, 2007 Posted July 13, 2007 Here is a script that I have used/modified to work wonderfully for many of my clients. http://lazynetworkadmin.com/content/view/7/6/No editiing of the script is necessary, just add the information to the csv file and the script will map the drives based off of AD group membership.
atari37 Posted July 13, 2007 Author Posted July 13, 2007 Here is a script that I have used/modified to work wonderfully for many of my clients. http://lazynetworkadmin.com/content/view/7/6/No editiing of the script is necessary, just add the information to the csv file and the script will map the drives based off of AD group membership.Thanks a lot for that script...It looks pretty neat. I can read scripts and almost any programming language but I'm not good at writing them. I will give this a try in a few. One quick question. Do I load both the .vbs and .csv files to AD->Group Policy->User Configuration->Windows Settings->Scripts(logon/logoff)?
chilifrei64 Posted July 13, 2007 Posted July 13, 2007 no you just load the .vbs file there.. both files should go in the netlogon folder on the logon server(global catalog)I actually just modified it to make the connection persistent, I forgot I did that earlier last month and never updated it on the site. copy it again so you get the update.
atari37 Posted July 13, 2007 Author Posted July 13, 2007 no you just load the .vbs file there.. both files should go in the netlogon folder on the logon server(global catalog)I actually just modified it to make the connection persistent, I forgot I did that earlier last month and never updated it on the site. copy it again so you get the update.Oh okay...So the only thing to edit is the .csv file? Does this look right? or or should I leave Group name alone. It looks like I should be replacing X with a drive letter but I'm not sure. What about !!? Thanks in advance.Group A,x:,\\my-fs\shareGroup A,!!,\\myads\printer1
chilifrei64 Posted July 13, 2007 Posted July 13, 2007 yessir.. that looks correct.. and yes.. you only need to edit the csv file..
atari37 Posted July 13, 2007 Author Posted July 13, 2007 Pretty neat...So the code actually knows what to map the drive letter as? I was going to replace X with the actual shared drive letters.Thanks.
chilifrei64 Posted July 13, 2007 Posted July 13, 2007 I am sorry .. I thought you wanted the drive letter to be X.... you need to change the x to the letter you want the drive letter to be
atari37 Posted July 13, 2007 Author Posted July 13, 2007 Ha...I figured that was the right way to set it up. X = M, etc. I have 5 drives to mount so using X for all wont' work.How about the printer (!!)? And I'm still only editing .csv right?Thanks
chilifrei64 Posted July 13, 2007 Posted July 13, 2007 yeah.. the !! just tells the script it is a printer.. obviously no drive letter... and yes.. only the csv file
atari37 Posted July 13, 2007 Author Posted July 13, 2007 yeah.. the !! just tells the script it is a printer.. obviously no drive letter... and yes.. only the csv fileA little disappointed...I'm not sure what I did wrong but the script didn't work for me. I uploaded both files to the netlogon share, which opens up by default when I click browse. I then added just the logon.vbs and hit okay but non of my drives got mounted automatically. This is kind of how I have it setup. I uploaded the logon.vbs without changing anything and then I edited the grouplist.csv as follows. In my AD I have a couple of groups. Almost all users belong to GroupA, GroupA also has read/write permissions on the shared drive on rob's-server\share1 but rob's server is not the AD server but this should matter right? I really need this thing to work...too many users to manually mount the drives. No error message either so I don't know what to diagnose, any help will be greatly appreciated.----------CSV FILE CONTENTS----------GroupA,M:,\\robs-server\share1----------CSV FILE CONTENTS----------
nmX.Memnoch Posted July 14, 2007 Posted July 14, 2007 -- Go to http://www.kixtart.org/ and download the latest version of KiXtart.-- Create a KIX directory on your NETLOGON share. Copy KIX32.EXE and WKIX32.EXE to that directory.-- Create a logon.bat batch file in your NETLOGON share with the following:@ECHO OFF%0\..\KIX\KIX32.EXE %0\..\logon.kixEXIT-- Create a logon.kix script file in your NETLOGON share with the following:If InGroup("GroupA") Use M: "\\robs-server\share1"EndIf-- Modify the user's domain account to add logon.bat as a Logon script on the Profile tab
chilifrei64 Posted July 14, 2007 Posted July 14, 2007 If you look up near the top of the script.. you can comment out the on error resume next and that will give you errors if it finds a problem. The only other thing I can think of is you need WSH 5.6 installed for it to work. that shouldnt be a problem because most all computers already have that installed. Some windows 2000 machines do not
atari37 Posted July 14, 2007 Author Posted July 14, 2007 If you look up near the top of the script.. you can comment out the on error resume next and that will give you errors if it finds a problem. The only other thing I can think of is you need WSH 5.6 installed for it to work. that shouldnt be a problem because most all computers already have that installed. Some windows 2000 machines do notHey, the script actually worked...I misspelled the group name and that gave me a headache for 2 days but I finally saw it and all is well now. Thanks a lot.One little thing though...I used the script to mount a network printer but when I right click the printer from the client pc and go to printer preference, it give an error. Something about "not being able to display all the settings". Have you encountered this problem?
chilifrei64 Posted July 15, 2007 Posted July 15, 2007 glad to hear the mapping the drives are working. Not I havent had that problem but it sounds like the script did its job. It sounds more now like a driver problem. Check and make sure that the driver is compatible or that it loaded correctly.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now