Exchange 2007

Posted on 2011-09-09
Last Modified: 2012-05-12
I have a task to find out all exchange users groups. can i find out on the shell with command that who is in which group?
Question by:orkinos
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 49

Accepted Solution

Akhater earned 500 total points
ID: 36515504
Kindly copy paste the below in a .ps1 file and run it, it will give you the list of all users and their corresponding groups

supposing you call the file GroupList.ps1 run

[PS] > ."\GroupList.ps1" > c:\list.txt

and the output will be saved in a file called list.txt
$users = Get-User -ResultSize unlimited

foreach ($user in $users)
   $userDN = [adsi](“LDAP://”+$user.DistinguishedName)
   $groups = $userDN.memberof
   echo `n
   echo "--------------------------------------------------------------------"
   foreach($group in $groups)
      $strGroup = $group.split(‘,’)[0]
      $strGroup = $strGroup.split(‘=’)[1]

Open in new window


Author Comment

ID: 36518219
is there a simple one? ;))
LVL 49

Expert Comment

ID: 36518267
What do you mean? Thiswill give you what you want
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 49

Assisted Solution

Akhater earned 500 total points
ID: 36518624
I dont understand what you dont like in my script. Anyway here are some oher options

Author Comment

ID: 36528674
is there a no command ? why script ?
LVL 49

Assisted Solution

Akhater earned 500 total points
ID: 36528694
because there is no one powershell command that will give you this

Featured Post

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In-place Upgrading Dirsync to Azure AD Connect
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
how to add IIS SMTP to handle application/Scanner relays into office 365.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question