Hi All,
I would like to export all users from my domain except the members of particular group members and its sub group members. Below is the script I used, but It worked for the primary group but it dinot worked for sub groups .
Get-ADUser -Filter * -Properties memberof | ? {(($_.memberof | Out-String) -notmatch 'ServiceAccounts')} | Select-Object -Property samaccountname
Please Help
Thanks, Sunil Gupta Sunilgupta@sunilgupta.com