?
Solved

Exchange 2007

Posted on 2011-09-09
6
Medium Priority
?
397 Views
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?
0
Comment
Question by:orkinos
  • 4
  • 2
6 Comments
 
LVL 49

Accepted Solution

by:
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
   $user.name
   echo "--------------------------------------------------------------------"
   foreach($group in $groups)
   {
      $strGroup = $group.split(‘,’)[0]
      $strGroup = $strGroup.split(‘=’)[1]
      $strGroup
   }
}

Open in new window

0
 

Author Comment

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

Expert Comment

by:Akhater
ID: 36518267
What do you mean? Thiswill give you what you want
0
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

 
LVL 49

Assisted Solution

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

http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/63ad55d1-1393-4533-8065-1d7cbd8657fa/
0
 

Author Comment

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

Assisted Solution

by:Akhater
Akhater earned 2000 total points
ID: 36528694
because there is no one powershell command that will give you this
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

Question has a verified solution.

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

Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

807 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