PowerShell for Windows Admins:

Active Directory


July 22, 2015  8:04 AM

Using parameters instead of read-host when getting AD replication data

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

I’ve seen a lot of scripts recently that use Read-Host to get input data.  This is generally not best practice – I tend to only use Read-Host if I want to get a password and obscure the text on screen. A better practice is to use parameters – either in a function or a script. As an...

July 17, 2015  12:37 PM

get-computerDN–dealing with non-existant computers

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

If you look at the working part of the code to discover the distinguished name of a computer:   £> $computer = 'w12r2sus' £> $filter = “(&(objectCategory=computer)(objectClass=computer)(cn=$computer))” £>...


July 16, 2015  12:47 PM

get-computerDN function

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

Last time I showed a bare bones function for using [adsisearcher] to retrieve the distinguished name of a domain computer. This is a somewhat expanded version of that function which adds in the sorts of features you’d want for a production ready function. function get-computerDN...


July 15, 2015  1:54 PM

ADSIsearcher returns

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

I’ve been using the Microsoft AD cmdlets (and before that the Quest cmdlets) for so long that I’d sort of forgotten about [adsisearcher]. It was introduced in PowerShell 2.0 and is a shortcut for System.DirectoryServices.DirectorySearcher A question in the forum about using this remotely...


July 2, 2015  1:20 PM

Processing NULL AD values

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

Back in this post

    0 Comments     RSS Feed     Email a friend


July 1, 2015  8:13 AM

Domain Admins password last set

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

A recent question on the forums asked about getting the date a password was last set and the password never expires status for the domain admins group This is one way of doing it Get-ADGroupMember -Identity 'Domain Admins' | foreach { Get-ADUser -Identity $psitem.samAccountName -Properties...


June 30, 2015  10:00 AM

Removing HomeDrive and HomeFolder settings

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

  Back in this post

    0 Comments     RSS Feed     Email a friend


June 27, 2015  9:58 AM

Multiple LDAP filters

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

Continuing our look at LDAP filters – remember the data set in use: £> Get-ADUser -SearchBase ‘OU=Testing,DC=Manticore,DC=org’  -Properties * -Filter * | select Name Name ---- Dave Green Dave Brown Dave White Jo Daven Fred Green Dale Greensmith Dave Greenly Individual...


June 26, 2015  2:16 PM

AD module cmdlets accepting LDAPfilter

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

In case you were wondering which cmdlets in the Active Directory module allowed you to use LDAP filters   £> Get-Command -Module ActiveDirectory -ParameterName...


June 26, 2015  2:10 PM

Basic LDAP filters

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

I recently showed how to create an LDAP filter for an attribute that wasn’t set.  I thought it would be useful to show some other LDAP filters. The examples are from a testing OU in my AD £> Get-ADUser -SearchBase ‘OU=Testing,DC=Manticore,DC=org’  -Properties * -Filter * | select...


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: