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
Solved

How to check that a users has "Exchange View-Only Administrator role" on Exchange 2007

Posted on 2010-08-18
5
1,138 Views
Last Modified: 2012-06-22
can anybody provide the powershell script to find out that if a user has "Exchange View-Only Administrator role" on exchange 2007. and similarly "View-Only Organization Management role" on exchange 2007.
0
Comment
Question by:vickytaurus
5 Comments
 
LVL 39

Expert Comment

by:Adam Brown
ID: 33468412
You can use get-rolegroup to view which roles exist in your environment. Then get-rolegroupmember to see which users are a member of each group. So you should be able to use get-rolegroupmember "view-only administrator" or something like that. You'll need to do the get-rolegroup to get the actual name. I don't have 2007 on my test network so I'm sorry I can't get any more specific.
0
 
LVL 28

Accepted Solution

by:
sunnyc7 earned 250 total points
ID: 33468616
Get-ExchangeAdministrator | fl

to check for a particular user
Get-ExchangeAdministrator | fl -Identity domain\username

get-rolegroup works for Exchange 2010 IMHO
Doesnt work on 2007
0
 
LVL 13

Assisted Solution

by:soostibi
soostibi earned 250 total points
ID: 33474121
Try this. In the last line, where actually you call the recursive function, you can set what exchange security group you want to check.
In this form you will get all the members of the view-only administrators (both users and groups), regardless of the fact, that the object is directly added to this group or if it is a member through an embedded membership.

If you comment out the 11th row, you'll get only users, not groups.
function get-exgroup ($exgroup, $global:collect = @())
{
	$exgroup.members | ?{$collect -notcontains $_.distinguishedname} | %{
		$g = Get-Group $_ -ErrorAction SilentlyContinue
		if(!$g){Get-User $_ | Add-Member -MemberType NoteProperty -Name Type -Value "User" -PassThru
			$global:collect += $_.distinguishedname
		}
		else{
			$global:collect += $_.distinguishedname
			get-exgroup $g $collect
			$g | Add-Member -MemberType NoteProperty -Name Type -Value "Group" -PassThru
		}
	}
}

get-exgroup (Get-Group "exchange view-only administrators") | ft name, type

Open in new window

0
 

Author Comment

by:vickytaurus
ID: 33753913
Issue resolved.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
In-place Upgrading Dirsync to Azure AD Connect
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

860 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