?
Solved

GETADUSER

Posted on 2014-11-17
1
Medium Priority
?
137 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
[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
1 Comment
 
LVL 22

Accepted Solution

by:
mcsween earned 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

765 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