I have a requirment to create a report/text file that displays the users that arent in specific AD groups. I know displaying users that are in specific AD groups is easy enough with Powershell.
Surely its possible to display the users that ARENT in specific AD groups with powershell also ??
Export a list of all users 'cn' in your active directory to a text file
Get-ADUser | Select-Object sAMAccountname > c:\temp\directory list
Depending on group sizes .netFramework has issues with groups with a large number of members (1500+) use 'dsget' to get a list of members in the group and store these into a variable
$groupName = dsget group "groupname" -members
compose foreach statement
if you need the actual code syntax -