Question

Can someone give me a brief Knowledge about Active directory in PowerShell. I just want to get the basic concept of active directory in PowerShell.

Was it helpful?

Solution

You might want to migrate this to ServerFault.

PowerShell allows you to perform some Active Directory queries/functions using commands provided by Microsoft.

Your question is too general for me to answer but I can give you an example. I think this will help you.

Suppose I want to retrieve all Active Directory users:

$users = Get-ADUser

Now suppose I want to retrieve only those users who are Enabled. I look up the documentation for Get-ADUser and see that I need to add the switch -LDAPFilter:

Get-ADUser -LDAPFilter "(&(sAMAccountName=b*) (!userAccountControl:1.2.840.113556.1.4.803:=2))"

Now suppose I only need the username and given name of the user (instead of all the properties). I add the -Properties switch:

Get-ADUser -LDAPFilter "(&(sAMAccountName=b*) (!userAccountControl:1.2.840.113556.1.4.803:=2))" -Properties sAMAccountName, givenName, sn, enabled

In general, PowerShell + AD allows you to query your Active Directory and even modify it in some cases. Certain AD functionality (Exchange for instance) requires separately-loaded or special snap-ins.

But to your question, PowerShell + AD is exactly that - PowerShell with an interface to Active Directory.

OTHER TIPS

Basically the Powershell for Active Diretory allows you to create scripts to do a bunch of stuff. For example you can create a lots of users in seconds, or you can check all the users properties relatives or specific for reports.

Here's one of my contributions in technet for example. https://gallery.technet.microsoft.com/exchange/Get-AD-Active-Users-cf308fec

I'll be doing this with html and jquery soon. not only for csv.

If you want to expand your knowledge about AD powershell I'll recomend you to take this free course in MVA

http://www.microsoftvirtualacademy.com/training-courses/using-powershell-for-active-directory

Have a nice day!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top