Solved

GETADUSER

Posted on 2014-11-17
1
130 Views
Last Modified: 2014-11-25
Hi,

I need to run the below script for an application vendor.  Can someone explain what the following command does?  I know the script will harvest information such as email address, title and so on in active directory but I would like to understand the detail.

Our users in AD are mostly in the USER container and there are some other groups scattered in other OUs.  Should I run the below in ourdomain.com?  If yes, do I need to specify or it will run from ourdomain.com by default?

Please advise.  Many thanks.

Get-ADUser –LDAPFilter "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2) (mail=*))" -Properties OfficePhone,EmailAddress,Title,Office,Department,Description,Manager | Set-Custodian -Company <company>
0
Comment
Question by:nav2567
1 Comment
 
LVL 21

Accepted Solution

by:
mcsween earned 500 total points
ID: 40447439
This will pull OfficePhone,EmailAddress,Title,Office,Department,Description,Manager from active directory users (person) whose account is not disabled and have anything in the mail attribute.

It will pull from the entire directory, I don't see any OU filters on this
I don't know what the Set-Custodian cmdlet does as it isn't a standard powershell command, might be proprietary to the software you are working with the vendor on.

!userAccountControl:1.2.840.113556.1.4.803:=2 Means No disabled users.
mail=* Means the mail attribute is not NULL
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …

770 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