Solved

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

Posted on 2010-08-18
5
1,140 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
To show how to generate a certificate request 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 >> Certificates…
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…

740 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