The purpose of this script is to enumerate all users that not belong to group names containing a specific pattern. The output shows samAccountName and email address.
The test of the attribute “$user.memberof” has been added because when this attribute is null, it means the user is only member of the built-in group “Domain Users”

Script (with Microsoft Active Directory module loaded : import-module activedirectory) :

Script (with Quest Active Directory module) :

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social Media Auto Publish Powered By : XYZScripts.com
%d bloggers like this: