Solved

GETADUSER

Posted on 2014-11-17
1
129 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This article will help you understand what HashTables are and how to use them in PowerShell.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

864 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now