Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Custom Script to retrieve user accounts with specific exclusions

$
0
0

Hello and thank you in advance for any help you can provide with this;

 

I need to retrieve a list of users from 2003 AD that are our home office (corporate) users only.  I need all user accounts either with or without e-mail.  Our home office users are spread throughout our AD along with many other User accounts, but the users I do not want to report on all exist in either the 'Sales Office' OU (or a nested OU of Sales Office -there are hundreds of nested OUs). 

The only thing that distinguishes home office or remote office users in AD is their location in AD.  All remote office users exist in a nested sub OU, corresponding to their office number, under The 'Sales Office' OU (O=ABCDomain.com, OU=Sales Office, OU=Divisions, OU=OFFXXX, User=Willey.Spillit) there are many other OUs at the same level as Sales Office that I would like to -by default, query for my answers, but need to exclude all users that exist under the Sales Office OU.

I also would like to filter out user accounts that are spread through out AD that were created for a failed voice mail integration, (the mail boxes for these 'Phone Extension' user accounts are homed on either of the the servers 'Diverse' and 'Universe'). I mention this because I was trying to use this as a secondary filter (only return the user account if the mailbox is not on Diverse or Universe).   

I am not currently in the position to clean up AD but need a list of all real 'Home Office' user accounts either with or without e-mail ASAP.

 

Thank you for your help and please let me know if I need to clarify anything


Viewing all articles
Browse latest Browse all 1277

Trending Articles