PowerShell for Windows Admins:

Active Directory


February 16, 2015  12:23 PM

Testing AD replication

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

I thought that using a workflow with its foreach –parallel construct would be a good way to test AD replication. I found that I got double the results – the foreach seemed to go to each machine twice. Eventually decided to perform the task sequentially Get-ADDomainController -Filter *...

February 14, 2015  5:42 AM

Modifying AD attribute – PO Box

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

I was left a question on this post -

    0 Comments     RSS Feed     Email a friend


February 9, 2015  12:21 PM

Error when AD object not found

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

This one popes up quite frequently If you attempt to access an Active Directory object that doesn’t exist you get an error. £> Get-ADUser Richardp Get-ADUser : Cannot find an object with identity: 'Richardp' under: 'DC=Manticore,DC=org'. At line:1 char:1 + Get-ADUser Richardp +...


February 6, 2015  2:17 PM

Workflow for last logon

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

PowerShell Workflows have been a bit of an underachiever in terms of their adoption and use. Something I read prompted the thought that there are a number of activities when working with Active Directory where you have to interrogate a number of machines to get the result. That’s something...


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


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: