Exchange 2007

Posted on 2011-09-09
Medium Priority
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 2000 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
Independent Software Vendors: 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 2000 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 2000 total points
ID: 36528694
because there is no one powershell command that will give you this

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

771 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