Get-ADObject to discover types?

Is Get-ADObject the correct cmdlet to gather all the types of objects (i.e. Users, Groups, et al) in use in AD? I want an inventory of whatever we actually have objects active in AD

 

thanks

Did you try it? Did it work?

I tried this:

Sort -Unique didn’t work as I expected so here is the one line I tried

Get-ADObject -Filter * -Properties * | Select ObjectClass -First 10

ObjectClass              
-----------              
domainDNS                
organizationalUnit       
organizationalUnit       
organizationalUnit       
computer                 
msFVE-RecoveryInformation
msFVE-RecoveryInformation
computer                 
computer                 
msFVE-RecoveryInformation

Try Group-Object

Group-Object : Cannot compare "@{ObjectClass=domainDNS}" to "@{ObjectClass=organizationalUnit}" because the objects are not the same type or the object 
"@{ObjectClass=domainDNS}" does not implement "IComparable".

How about this?

Get-ADObject -Filter * | Select-Object -Property ObjectClass -Unique

Thank you Wow, that’s a lot of Classes (82). I want to know about the ones that actually have any values in them. Maybe that’ll uncover only the largest ones, I hope

Something like:

Get-ADObject -Filter * | Select-Object -Property ObjectClass -Unique | Where {$_.ObjectClass ???}

Yes but there are a lot of returns there that we don’t use. How can I query for ObjectClass that actually have values/data?

You asked for this:

… gather all the types of objects …

What for do you actually need this information?

Yes, thank you I didn’t realize that were that many objects (count = 82). I’d like to winnow that down to only the (unique) objects/classes that actually have data or values in them.

OK, and now just out of curiousity I’ll ask again: What for do you actually need this information?

Until now I couldn’t think of any benefit from this info.

ah sure, we want to consider a re-org of our OU design and want to consider how its currently being provisioned for objects

Hmmm … actually I’m even more confused now. :wink: Wouldn’t it bee better to have a kind of tree view of your OUs and elements in those OUs to have an overview?

And just to mention it at least once - The OU structure of your AD should not necessarily reflect the company structure. :wink:

.