Hi Folks !!!
I'm 2 groups named group1 and group2 and I need get all user of the group1 and all users of the group2... I have this script:
Get-ADUser -Filter * -Properties * | where {$_.MemberOf -match "Group1" -and $_.Enabled -eq "True"} | select Name, LastLogonDate | Sort-Object NameThis work fine for me, but when I trying to get all users outside these groups I trying this:
Get-ADUser -Filter * -Properties * | where {$_.MemberOf -notmatch "Group1" -and $_.Enabled -eq "True"} | select Name, LastLogonDate | Sort-Object NameThis return me some users that's in Group1 or Group2 too...
Any suggestion !?
Jimcesse Principal: http://sysadmin-cr.com/ Alterno: http://blogs.itpro.es/jimcesse