PowerShell for Windows Admins:

Active Directory


January 26, 2015  12:41 PM

Unravelling lists of distinguished names

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

There are a number of AD properties such as MemberOf and directrports that consist of a collection of distinguisednames.  Sometimes you need the  name  of the object rather than the distinguished name: function getname { [CmdletBinding()] param ( [string]$dn ) $name = Get-ADObject $dn...

January 26, 2015  11:08 AM

Filtering on if an AD property exists

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

There are times when you want to filter the results based on whether a user has an AD property set.  You could do this: Get-ADUser -Filter * -Properties Title | Where Title  | select Name, Title However, that involves pulling back all of the users and then filtering. Not very efficient...


January 11, 2015  5:21 AM

Add-Computer is your friend

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

When spinning up new machines and joining them to the domain at least 2 reboots are required. One when you rename the machine (Windows used to let you specify the name at install time – the removal of that feature was a step backwards) and the other when you join it to the domain. I was...


January 9, 2015  11:30 AM

foreach, pipelines and $_

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

I’ve recently seen a few questions where people have been using a pipeline inside a foreach loop and experienced problems when they’ve tried to access properties on the looping objects. To illustrate we’ll start with a CSV file containing emailaddresses and job titles. £> Import-Csv...


December 30, 2014  9:10 AM

ANR and AD searches

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

A comment on this post - 

    0 Comments     RSS Feed     Email a friend


December 29, 2014  5:50 AM

Using GivenName and Surname instead of samAccountName

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

A recent comment on this post -

    0 Comments     RSS Feed     Email a friend


December 17, 2014  10:00 AM

Selecting AD properties

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

Saw a question on the forums about selecting name properties using the Microsoft AD cmdlets.  By default Get-AdUser returns a limited subset of properties: £> Get-ADUser -identity richard DistinguishedName : CN=Richard,CN=Users,DC=Manticore,DC=org Enabled           :...


July 12, 2014  4:28 AM

Time to stock up your book collection?

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Books

Manning are offering 40% off everything – print & ebooks – www.manning.com. They have a very extensive set of PowerShell books – now would be the time to add to your collection


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: