Solved

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

Posted on 2010-08-18
5
1,144 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
[X]
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
5 Comments
 
LVL 40

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

739 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