Solved

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

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

Expert Comment

by:Adam Brown
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Issue resolved.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now