Filter Distribution Group based on Names - Exchange
hello,
we have around 1.5lakhs distribution lists in our organization.
i need extract list of dls filtering out has "-restrict", "-delegate", "-access" @ end (for alias). want dls without these words. tried command still extracting whole list without filtering requirement. please help?
my command:
[ps] c:\>get-distributiongroup -resultsize unlimited | {($_.alias -ne "*-delegate") -and ($_.alias -ne "*-restrict")} |select distinguishedname |export-csv d:\dlinfo.csv
please help
never giveup till want.
use -notlike instead 0f -ne
ex
get-adgroup -filter *| {($_.name -notlike "*users") -and ($_.name -notlike "*admins")}
Windows Server > Windows PowerShell
Comments
Post a Comment