-
April 29th, 2004, 10:47 AM
#1
How to make a logon script, that maps network drives ???
We just installed a Windows 2003 server, and are having alot of trouble getting a logon script to work.
We have read the help files, and done what they say, but it still doesn nothing when trying to login to the server.
It will log us in, and let us in the apropriate files, but I dont think the script is wroking, or running at all.
Becuase it is not mapping the network drives and folders, as we told it to.
Please tell me how to write a simple script to map drives and folders at logon, and how to make it run.
Thanks alot.
-
April 29th, 2004, 10:56 AM
#2
Here is the script that we are trying to use.
Const ENGINEERING_GROUP = "cn=engineering"
Const FINANCE_GROUP = "cn=finance"
Const HUMAN_RESOURCES_GROUP = "cn=human resources"
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "G:", "\\test_share" & wshNetwork.UserName
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, ENGINEERING_GROUP) Then
wshNetwork.MapNetworkDrive "L:", "\\R Folder"
end if
-
April 29th, 2004, 10:57 AM
#3
Tech-To-Tech Mod
it's pretty simple. what have you already done? if you can detail what you tried it will make things a lot easier.
but basically the script is just a batch file that utilizes net use commands
i.e.
net use z: \\server\share
and you execute it from the user properties in active directory users and computers. under the profile tab there is a place to specify a logon script.
you must be sure to have the permissions set correctly on the shares so that when you are mapping a share to a drive for a user he/she actually has permissions to use the resource.
Last edited by kato2274; April 29th, 2004 at 06:05 PM.
Nonsense prevails, modesty fails
Grace and virtue turn into stupidity - E. Costello
-
April 29th, 2004, 11:01 AM
#4
Tech-To-Tech Mod
Originally Posted by jtice
Here is the script that we are trying to use.
Const ENGINEERING_GROUP = "cn=engineering"
Const FINANCE_GROUP = "cn=finance"
Const HUMAN_RESOURCES_GROUP = "cn=human resources"
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "G:", "\\test_share" & wshNetwork.UserName
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, ENGINEERING_GROUP) Then
wshNetwork.MapNetworkDrive "L:", "\\R Folder"
end if
if this running server side or client side? this would be SO much easier to do via active directory users and computers
example:
in profiles of engineering group set a logon script of engine.bat
the engine.bat has the command
net use L: \\server\share
for the user specific maps, the %username% variable works in a batch script
ie.
net use Z: \\server\home\%username%
Last edited by kato2274; April 29th, 2004 at 06:05 PM.
Nonsense prevails, modesty fails
Grace and virtue turn into stupidity - E. Costello
-
April 29th, 2004, 11:04 AM
#5
I have tried placing the script in the user part, and under the startup/shutdown parts.
I actually placed the script in EVERY place I could see that you could put a script.
We need this to be a global script, not one that is placed in each users profile. That would take more time to do.
This needs to be a script that is ran when ever ANYone logs in.
Then that script looks to see who logged in, and what drive is supposed to be mapped to them.
When we goto login, it basically does nothing, acts like the script isnt even there.
-
April 29th, 2004, 11:07 AM
#6
I dont see where I can assign a script to a group.
I went to properties of the group, as I would a user, and I dont see anythign about it there.
If I goto a users properties, I see where I can add a script.
But not for a group.
-
April 29th, 2004, 11:18 AM
#7
Tech-To-Tech Mod
Originally Posted by jtice
I dont see where I can assign a script to a group.
I went to properties of the group, as I would a user, and I dont see anythign about it there.
If I goto a users properties, I see where I can add a script.
But not for a group.
you're right. I got ahead of myself. what I usually do is setup one user for a group. then just copy that user when I need another user in that group. gives them the same properties. ......I was just thinking of it this way because we have group logon scipts.....i.e. development.bat etc. they aren't actually applied in the group properties, but they are applied to the group when creating a new user and I copy an existing development group user
Nonsense prevails, modesty fails
Grace and virtue turn into stupidity - E. Costello
-
April 29th, 2004, 11:25 AM
#8
Originally Posted by kato2274
you're right. I got ahead of myself. what I usually do is setup one user for a group. then just copy that user when I need another user in that group. gives them the same properties. ......I was just thinking of it this way because we have group logon scipts.....i.e. development.bat etc. they aren't actually applied in the group properties, but they are applied to the group when creating a new user and I copy an existing development group user
Ah I see what you are doing.
So, there is no way to assign a script to a group?
Shouldnt there be a way to make a script run when ANYone logs in?
And that script map drives according to who that user is?
I also went to a users profile, and told it to use this script, but it still didnt do anything.
Also, your are mentioning a .bat file, not a .vbs script file, could that be part of it? Or can they both work?
-
April 29th, 2004, 11:32 AM
#9
Tech-To-Tech Mod
Originally Posted by jtice
Ah I see what you are doing.
So, there is no way to assign a script to a group?
Shouldnt there be a way to make a script run when ANYone logs in?
And that script map drives according to who that user is?
I also went to a users profile, and told it to use this script, but it still didnt do anything.
Also, your are mentioning a .bat file, not a .vbs script file, could that be part of it? Or can they both work?
vbs scripts should work. have you tried instead of setting the script in users profiles to setting it in the domain group policy. this may be the way to get it to work. try under user configuration - administrative templates - logon - run these programs at user logon setting. set the permissions to everyone.
again . . . . not the way I'd do it. . . . . but this seems viable and may be your answer.
Last edited by kato2274; April 29th, 2004 at 11:37 AM.
Nonsense prevails, modesty fails
Grace and virtue turn into stupidity - E. Costello
-
April 29th, 2004, 11:59 AM
#10
Tech-To-Tech Mod
the script works fine. I ran it on my local machine. (had to change shares and groups and such) but it works just fine.
I would try the group policy approach. I think it should work and would keep it on the server side so that even if someone brings a laptop in and logs onto the domain, the script executes......let me know if it works. I'm curious....but I'm not going to apply it to our production domain
Nonsense prevails, modesty fails
Grace and virtue turn into stupidity - E. Costello
-
April 29th, 2004, 12:33 PM
#11
Originally Posted by kato2274
the script works fine. I ran it on my local machine. (had to change shares and groups and such) but it works just fine.
I would try the group policy approach. I think it should work and would keep it on the server side so that even if someone brings a laptop in and logs onto the domain, the script executes......let me know if it works. I'm curious....but I'm not going to apply it to our production domain
I must be missing something.
I tries everything you said, nothing is mapping the drives.
I even tried your .bat file.
all it has in the command:
use net L \\server1\R Folder
server1 is the name of our server
R Folder is the name of the folder I want to map.
I dont get any error messages at all during logon either.
I went to Group Policy Editor > User Config > Admin Templates > System > Logon > Run these programs at user Logon
-
April 29th, 2004, 03:17 PM
#12
Driver Terrier
I even tried your .bat file.
all it has in the command:
use net L \\server1\R Folder
net use L: .....
Never, ever approach a computer saying or even thinking "I will just do this quickly."
-
April 29th, 2004, 05:30 PM
#13
Originally Posted by NooNoo
net use L: .....
Heh, yea, i noticed that.
Still doesnt work.
Is there maybe something that I dont have installed?
Or a setting thats not right?
-
April 29th, 2004, 06:02 PM
#14
Tech-To-Tech Mod
Originally Posted by jtice
Heh, yea, i noticed that.
Still doesnt work.
Is there maybe something that I dont have installed?
Or a setting thats not right?
OK you gotta attack this one piece at a time. run your script locally on a client machine and also try the net use commands from the local machine. if the script and net use commands work there then you can move to trying to deploy the scripts. if it doesn't you gotta find out why. forget logging in right now. just verify your commands, then worry about deploying them
Nonsense prevails, modesty fails
Grace and virtue turn into stupidity - E. Costello
-
April 29th, 2004, 08:57 PM
#15
Originally Posted by kato2274
OK you gotta attack this one piece at a time. run your script locally on a client machine and also try the net use commands from the local machine. if the script and net use commands work there then you can move to trying to deploy the scripts. if it doesn't you gotta find out why. forget logging in right now. just verify your commands, then worry about deploying them
I now know that
net use Z: \\CompName\Folder
Does work if ran on a machine locally.
Now, there must be something either making the script not run, or the login itself not calling it up properly.
What this is from, I do not know yet, i am betting some configurration i am missing.
Similar Threads
-
By 70-240 in forum Certification
Replies: 14
Last Post: February 20th, 2012, 03:35 AM
-
By death in forum Networking
Replies: 3
Last Post: April 23rd, 2001, 09:40 PM
-
By gmbruin in forum Windows NT/2000
Replies: 4
Last Post: March 22nd, 2001, 05:19 PM
-
By Note in forum Windows NT/2000
Replies: 3
Last Post: August 1st, 2000, 07:59 AM
-
Replies: 1
Last Post: April 13th, 2000, 12:56 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks