[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 842
  • Last Modified:

script to find all mail enabled security groups

Hello,

I would like to tidy up AD by renaming all mail enabled security groups. We have many of them in AD. So my question is:
Is there a script that would query AD so that all mail enabled security groups show up in the results?

Hope I am making sense,
Tacobell2000
0
Tacobell2000
Asked:
Tacobell2000
1 Solution
 
Tacobell2000Author Commented:
Got the answer:

DSQuery * ForestRoot -Filter "(&(samAccountType=268435456)(mail=*))" -Limit 0 > c:\results.txt
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Tackle projects and never again get stuck behind a technical roadblock.
Join Now