I am trying to make a script that will pull information from computers in an AD OU
It will pull the name, description and what security groups each computer belongs to I.e
computer001 - this is pc 001 - bitlocker clients, cm_etcgroup
It works fine with an OU only with computers, however, if an OU contains security groups, or other objects it wont pull the member of group information
If your asking why it won’t pull info for other object types besides computers, that would be because you’re using Get-ADCOMPUTER. Use Get-ADObject instead.
You may elaborate a little more detailed what you’re actually trying to do. It seems like you’re expecting something what’s either not possible or at least very unlikely.
I need to pull the following information from certain OUs in our active directory, namely
Name of the object (mainly computers)
Description of the object
The names of groups those objects are members of (Properties > Member of)
If i run the script on an OU with only computers it seems to work fine, however, the OUs i need info from have a mixture of global security groups, computers and another OU
Honestly, you haven’t cleared it up at all. You’re saying the script will pull all the info you desire properly if only computers list in the OU, otherwise it will only pull the name and description if there are other objects in the OU? Your “MemberofGroups” property just comes back blank? That makes zero sense.