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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting username from AD

Status
Not open for further replies.

jamesjames1

Technical User
Jun 18, 2004
81
GB
Hi,

Is there a way to find out if a user is a member of a particular group. I need to move a computer object, based on last logged on user, to a specific OU. The OU is determined by group membership.

I have found some script which uses script for current logeed user but this is not good as I am reading usernames (DN's) from an Excel Spread sheet.

Any input would be gr8 -ta

james
 
Yes, this is easy to do. Take a look at my login script FAQ which does just what you need. faq329-5798.

In my login script I grab the current user name and then from that bind to the user ID to check group memberships. Reading from Excel would simply replace where I grab the user name. You could use all the same code to bind tot he user object and then check group memberships.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top