How to find user's OU at the time of login?

  • Thread starter Thread starter carlos
  • Start date Start date
C

carlos

Hello,

Scenario:

We are using OU based GP, to run a script(changereg.bat), at the time of
logon.
The script will read a file(userlist.txt) and execute commands based on
user's logon name.

Every thing works fine, when configured as domain logon script or as a GP.

Problem: The file, that has user list and commands for the users, is too
big(userlist.txt)(6 pages!), so at the time of login, some users are facing
slowlogon issues and the DC's response will be very slow during logon hours.

If we reduce the file size ( to one page), by removing some users from the
file, userlist.txt, everything is fine, there is no perfrmance/slowlogon
issues..

As a workaround, we are planning to have multiple files, one file for each
OU..

Is there a variable, which will allow me to find the user's OU at the time
of login?

or any other workaround?

Thanks
Carlos
 
Why not just apply the scripts you want to run for each OU to the OU itself?

User Configuration | Windows Settings | Scripts (Logon/Logoff)

What you're doing makes it seem like you're missing the point of group
policy.

Oli
 
I mean that using the userlist.txt file at all is missing the point of group
policy. Are you saying that each user has totally individual scripts for
loging? If not, then group together the functionality and manage it with
group policy.

Remember that you can put users into groups and apply security to the
policies to ensure that only if a user is a member of a certain group will
each policy be applied. That way, you don't end up creating a massive tree
of OUs just to control what happens when each user logs in.

Could you post a snippet of you userlist.txt file to make things clearer?

Oli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top