Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login Script Acting Weird

Status
Not open for further replies.

oneworld

MIS
Sep 3, 1999
138
US
I have a log in script called login.bat. This disconnects any drive mappings that the user has.

It then calls a vb script that will map drives based on group memberships. It will also run a program once a particular drive is mapped.

Both files are in the netlogon share. Here is the weird part:

The drive mapping and the running of the program only works for domain admins. I even granted everyone full control over the netlogon share to test and it still didn't work. But if I add a user who is not working correctly to the domain admins group, then the script works just as expected.

Any ideas?

Joe

Joe - a.k.a. Oneworld


 
I am not sure I understand what you are asking?

Joe - a.k.a. Oneworld


 
a share gives u the right to logon, the ntfs permissions allow or deny access to a file/folder in that share.
right click the script, choose properties, security, advanced and then effective rights. under group/users select the domain user group and say ok, then ull see the permission granted
 
Thank you but that didn't work. Is there a way to map drives based on group membership in a bat file? I created a bat file to map a single drive and that works just fine.

Joe - a.k.a. Oneworld


 
u could try dsquery user | dsget user <Benutzer-DN> -memberof and parse the result in a text file wich u then can work with.
 
I would try KiXtart a free scripting tool.
You can check for memberships to manage drive mapping even nested groups. There is an example in the download.
You will need to put the exe file in the netlogon folder and call it with the path to the script kix32.exe \\servername\netlogon\logon.kix

Works great and it's free
 
Even weirder part...I got the script working just fine. The issue however is that the users groups are not being picked up.

I added lines in the script to count the number of groups that the user belongs to, and it was always one below. If the user is in two different groups the script would tell me that they only belong to one.

I created a dummy group added all the users and everything is working.

Joe - a.k.a. Oneworld


 
Are the group the user belongs to nested? This could be the issue. That or your script is stopping after it finds a group and just takes the first one it finds.

 
Is there a reason that you're using a .bat script and then a .vbs script? Seems to be more than what's needed.

You might also get more traction on this issue in the vbscript forum, where resident guru marcdmac hangs out.

Pat Richard MVP
Plan for performance, and capacity takes care of itself. Plan for capacity, and suffer poor performance.
 
the program you're running might require local system administrator rights to run hence it will map or delete drives and then stop when trying to run the file. give a test user local administrator rights and see what happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top