If you need to see productive service (AD) individuals in the dominion, the Powershell Get-Aduser management is here now.

Consumer profile were assigned to workers, provider records alongside sources. Before long, advertisement owner account are receiving challenging to handle.

Discover, document preventing insecure energetic database profile passwords in your environment with Specops’ free code Auditor expert. Download they immediately!

Utilising the Get-AdUser PowerShell cmdlet, you can get AD consumers many different ways. Here, you’re planning to see some of those tactics and the ways to make use of this handy cmdlet.

Dinner table of elements


To make use of the Get-AdUser cmdlet examples dealt with on this page, ensure that you get the appropriate:

  • On a computers running Windows Computer enrolled with to an advert dominion
  • Logged in as an AD cellphone owner profile
  • Get the PowerShell productive listing section mounted

Unearthing a person Levels with Recognition

The Get-AdUser cmdlet features one function plus one goal merely. They is present to produce as many options as it can to obtain dominion users. In the event that you already know the individual brand to look up, you should use the recognition quantity.

The identification quantity helps you render almost certainly four various identifiers.

  • distinguishedName (DN)
  • samAccountName
  • GUID
  • SID

Below you will discover some examples of finding a user accounts utilizing numerous identifiers. Notice that they comes back a couple of post attributes per each cellphone owner membership.

The commonest trait for the Identity factor is the samAccountName attribute.

The Get-ADUser air filter

If you need to come across one or more domain cellphone owner or don’t recognize an identifier, utilize a filtration. For this, you’re ready to have a few parameters easily accessible named filtration and LDAPFilter .

Each filter parameter enables a person to grant a conditional declaration. Once this circumstances happens to be achieved, Get-AdUser will come back owner profile complementing that situation.

The commonest quantity to filtering consumers is actually filtering . The filtration factor lets you produce problems that are exactly like the PowerShell Where-Object demand filter syntax.

The filtration factor makes use of a communication known as PowerShell phrase words syntax. This words is a little like exactly what you’d make use of with Where-Object although quite. For a failure of ways to use this air filtration system, check out this Active list and LDAP air filters document.

Further down is definitely a typical example of using the air filtration system factor. This sample produces an advert feature ( givenName found in this example) and designs an issue. The filtration is let consumers to return should they have a givenName corresponding to Adam .

The additional selection choice is LDAPFilter that won’t generally be sealed in this specific article. More resources for the LDAPFilter and its particular syntax, check out this content on proactive Directory and LDAP filter systems.

Utilizing Get-AdUser by OU

By giving an identity or filtration, PowerShell comes back all users within the domain name complimentary the condition. It won’t minimize by OU. You’ll must create a “filter” for Get-AdUser to filtering by OU using Get-Aduser -SearchBase .

Using the SearchBase quantity helps you get started researching a user accounts in a specific OU. The SearchBase factor takes an OU’s prominent identity (DN).

One example is, you might find all customers in the MyUsers OU as exhibited below. By using the air filtration system of * way to match all customer accounts.

Maybe you simply want to find customer profile in a use a weblink single OU and exclude any kid OUs. In that case, you could utilize the SearchBase and SearchScope parameters. The SearchScope vardeenhet specifies how strong in OU series you’d like to google search.

Assuming you’d choose to find all consumer profile in an OU as well as youngsters OUs, you’d need 1 for all the SearchScope advantage. If you’d want to flick through all son or daughter and grandchildren OUs, you’d incorporate repayments

Lower try a good example of on the lookout for individual accounts inside MyUsers OU and baby OUs beneath it.

Using Alternate Credentials

Automatically, Get-AdUser is going to run beneath the framework associated with the logged-on customer. You could offer alternate qualifications using the Credential vardeenhet.

To authenticate with alternate credentials, produce a PSCredential object using Get-Credential like underneath:

The PowerShell Get-AdUser Land Vardeenhet

After you owned Get-AdUser , you’ll promptly see only a few characteristics tend to be came back. You’ll in addition realize that even if the result try piped to Select-Object -Property * , all attributes aren’t still came home.

To work with PowerShell to have post owner qualities, use residential property vardeenhet. This factor welcomes more than one comma-delimited qualities showing by using the output.

Below you’ll notice a good example of utilizing Get-AdUser to locate all characteristics for most cellphone owner records with a givenName of Adam . The production is definitely snipped but you’ll see different comfortable elements like email address, password residential properties and below.


The Get-ADUser cmdlet is definitely an useful management discover advertising cellphone owner accounts, develop account and much more. It’s a great way to extract post owners from a domain. For a failure of Get-AdUser and all of details, see the services material by running Get-Help Get-AdUser .

For many individuals various other samples of guidelines for Get-AdUser , visit the article dynamic list texts Aplenty: arrive and obtain It!.

Even more from Adam The Automator & Relatives

Read your Active directory site for 750M+ known released accounts with a no cost read-only Specops Password review.

We’ve put together a list of the methods most of us, at ATA, can wholeheartedly advocate.

You will want to write on a platform with an existing guests and share your understanding utilizing the planet?

Share this article
About Me

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec cursus arcu. Donec venenatis tristique mauris sagittis.

Follow us on social media.