This is the output I’m trying to accomplish (treat the periods as white-space please):
Number…Name
-------------…---------
1…OU1
2…OU2
3…OU3
I feel like using Get-ADOrganizationalUnit (with appropriate -Filter, -SearchBase, and -SearchScope) and piping to Format-Table with a hash table would be the route to go, but I am a rookie with hash tables. Any tips?
The simplest solution for you coud be to search for an example without index and add it then .... ;-) My recommendation would be to use a custom object rahter than a hash table.
Richard: When I was looking into this issue, I cam across an article that Don Jones wrote back in 2012 (https://technet.microsoft.com/en-us/library/hh750381.aspx). I found two things I thought I should mention that maybe you can relay to him.
In all of his Add-Member command, there is no space between the -MemberType parameter and the NoteProperty value that follows it (See example line below). Don’t know if he can correct those entries
The article is about powershell, and all of the code is powershell code, but the code, for some reason, shows up under boxes labeled “VB” (Visual Basic, of course). Not sure if that’s intentional (i.e. he had no choice) or if it’s correctable, so that any possible confusion for readers could be avoided.