Here’s a great script I thought about sharing since I find it to be very handy to assist for the following requirement.
Create a “all computers” collection for software updates and exclude various OU’s that have computers not allowed to be updated for various reasons. Please modify the RED areas with the correct information. The great part is, you don’t have to spell out the full OU name to be excluded.
select sys.ResourceId, sys.ResourceType, sys.Name, sys.SMSUniqueIdentifier, sys.ResourceDomainORWorkgroup, sys.Client