Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

How to exclude Group members of a group in powershell?

$
0
0

Hi All,

I would like to export all users from my domain except the members of particular group. Below is the script I used, but I did not get any result.

Please Help

Get-AdUser -filter * |? {($_.distinguishedname -like "*OU=Users*") -and ($_.memberof -notlike "Exception_Accounts_ServiceAccounts")} | select samaccountname





Thanks, Sunil Gupta Sunilgupta@sunilgupta.com


Viewing all articles
Browse latest Browse all 2562

Trending Articles