Windows 8 Active Directory PowerShell Provider

One of the most potentially useful features of the AD tools provided by Microsoft is the AD PowerShell Provider. A Provider in PowerShell allows a user to interact with a data structure similarly to how they would interact with a file system. You can change directories, list items, create new items, and delete items. This is a really good model for any kind of hierarchical data. AD is a great example. I like to use PowerShell providers to find and navigate through data very quickly.

The problem I have with the AD Provider is the names that are used when you navigate into Active Directory. In this case, a picture is worth a thousand words.


What do you mean the path doesn’t exist? According to the output of my last ls command, I should be able to cd into windev, configuration, and 3 others. It turns out you don’t use the name of the “Name” property. You have to cd into the “Distinguished Name”


To me, that is very unintuitive and does not align well with the PowerShell mantra, “Think”, “Type”, “Get.” Well in the Windows 8 Developer Preview Server, you can address this issue. The default drive AD: still exists and behaves in the same way, but it doesn’t have to stay that way.

You can remove the AD PSDrive and create your own new one. The trick here is to use the –FormatType switch with the parameter “canonical.” This will change how the drive is set up and what names the provider binds to


Now we can navigate through AD much more easily.


Comments (1) -

Bartek Bielawski 10/27/2011 10:19:58 AM

Great article!
I have only one comment... This sentence: "Well in the Windows 8 Developer Preview Server, you can address this issue." may confuse people that this is new feature of win8, and this is not the case: -FormatType Canonical can be used in w2k8r2 and win7 with RSAT as well (I've used it for quite some time). Smile I also think it worth to mention that with that you can also use more 'natural' -Root path (e.g. Smile
Just my 0.02$

Pingbacks and trackbacks (1)+

Comments are closed