Active Directory configuration snapshot

‘Sup PSHomies,

Back in the days I had some vbs scripts to make a quick assessment of whatever  Active Directory I was working on. Guess it’s time to upgrade to PowerShell! 😉

Ever since I read the book on Big Data: A Revolution That Will Transform How We Live, Work, and Think, I’ve started looking at my datasets differently. When gathering data, we usually assume that our dataset has a singular purpose to which its value is tied.

By not being overly occupied with filtering the dataset we can always revisit and probably gain more insight we hadn’t thought of at the time. (I’ll demonstrate later on). Let’s dive in!

I’ve create a hashtable to save all necessary bits for further processing. Noticed I didn’t filter just gathered all possible information (-Filter *)

Quick side step: I’ve exported the Object using Export-Clixml for future use, to be continued… 😉

The fun really begins when we run queries against $ADSnapshot

Let’s take $ADSnapshot.DomainControllers as an example

How many DomainControllers are there?

@($ADSnapshot.DomainControllers).Count

What are their names?

$ADSnapshot.DomainControllers | Format-Table Name,

Here’s where the added value comes in. If we had opted for a singular purpose dataset then that would have been all the data we could have extracted. Suppose I want to know which site the Domain Controller resides in?

$ADSnapshot.DomainControllers | Format-Table Name,Site

But there’s even more data you could extract. Have a look at the properties available:

$ADReport.DomainControllers | Get-Member -MemberType Property

Need the Partitions?

$ADReport.DomainControllers.Partitions

How about the ports available?

$ADSnapshot.DomainControllers | Format-Table *Port

I think you get the idea… 😉

There’s even an added bonus I hadn’t thought of… remember the export using Export-Clixml? Well we can use that to compare previous Snapshots

Did the FSMO Roles Change since last snapshot?

Compare-Object $SavedADSnapshot.DomainInformation $ADSnapshot.DomainInformation -Property PDCEmulator,RIDMaster,InfrastructureMaster -IncludeEqual

So there you have it, Active Directory configuration snapshot! By gathering all possible information first and processing later on, we can uncover additional information if needed… I’ve been in a situation where I had a limited window to gather Active Directory information… The pressure! If I missed any bit, then that was it, I didn’t get a second chance! Now I can gather all possible information and revisit the dataset on the off-chance I missed something the first time…

Next time I’ll show you how to create a HTML report using the saved $ADReport… 😉

Hope it’s worth something to you.

Ttyl,

Urv

Advertisements

5 thoughts on “Active Directory configuration snapshot

  1. Pingback: Active Directory configuration report | pshirwin

  2. Pingback: Active Directory Operations Test | pshirwin

  3. Pingback: PScribo for the win! | pshirwin

  4. Pingback: Powershell Reporting using Pscribo Part 1 -Getting the XML | Wei-Yen Tan’s IT Journal

  5. Pingback: AD Operation Validation class | pshirwin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s