Solved

simple script code to find organizational unit

Posted on 2012-04-02
7
250 Views
Last Modified: 2012-04-26
does anyone know of a simple piece of code for a login script on windows server 2008 that will find which organizational unit the person is placed in?  I have ou such as manager, itstaff, tellers, accounting.  I know how to ask what computer they are logging into and who they are, but asking for their OU is escaping me.

gary
0
Comment
Question by:javagair
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 21

Expert Comment

by:motnahp00
ID: 37797105
Out of curiosity, why are you not using the Object tab in ADUC?
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 37797330
The following command ran from any domain controller or any computer with Active directory users and computers installed will tell you the location.

dsquery user -samid "username"
0
 

Author Comment

by:javagair
ID: 37798578
either I don't understand you you don't understand what I'm doing.  When one of the domain users in another town logins in the morning I assign them network drives.  Each OU such as managers gets different mapped drives than say a secretary; but I don't want to have enough switch cases for 110 employees.  I would just like to have 8 cases where if they belong to a certain OU then they get particular mapped drives.

gary
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 21

Accepted Solution

by:
motnahp00 earned 250 total points
ID: 37798912
Create a GPO for drive mappings. You can apply this particular policy at the domain level if you like.

User Configuration -> Preferences -> Windows Settings -> Drive Maps -> New Mapped Drive

Action: Update
Location: \\server1\HR
Label as: HR
Drive Letter: X
Common tab -> Item-level targeting -> OU

Create a new drive map for each OU instance.

I hope this is what you are looking for.
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 37800766
Montnahp00 has the right answer. Group policy preferences will let you target the specific OU's that you want and apply the drive maps. Very easy solution to your issues.
0
 

Author Comment

by:javagair
ID: 37801361
I have windows xp pc mixed in with sys 7 and I am told that group policy drive mapping does not work for xp.  So I am back to a script.

gary
0
 
LVL 35

Assisted Solution

by:Joseph Daly
Joseph Daly earned 250 total points
ID: 37801416
Group policy preferences work perfectly fine with windows XP. All they require are the client side extensions to be present on the computer. This update came out a fair amount of time ago so if you have been doing regular updating/patching they might already have it installed.

http://www.microsoft.com/download/en/details.aspx?id=3628
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked if I could set up a fax machine so that incoming faxes were delivered to people's Exchange inboxes and so that they could send faxes from their desktops without needing to print the document first.  I knew it was possible but I had no id…
To effectively work with Diskpart on a Server Core, it is necessary to write some small batch script's, because you can't execute diskpart in a remote powershell session. To get startet, place the Diskpart batch script's into a share on your loca…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question