TechNet
Products
IT Resources
Downloads
Training
Support
Products
Windows
Windows Server
System Center
Microsoft Edge
Office
Office 365
Exchange Server
SQL Server
SharePoint Products
Skype for Business
See all products »
Resources
Channel 9 Video
Evaluation Center
Learning Resources
Microsoft Tech Companion App
Microsoft Technical Communities
Microsoft Virtual Academy
Script Center
Server and Tools Blogs
TechNet Blogs
TechNet Flash Newsletter
TechNet Gallery
TechNet Library
TechNet Magazine
TechNet Wiki
Windows Sysinternals
Virtual Labs
Solutions
Networking
Cloud and Datacenter
Security
Virtualization
Updates
Service Packs
Security Bulletins
Windows Update
Trials
Windows Server 2016
System Center 2016
Windows 10 Enterprise
SQL Server 2016
See all trials »
Related Sites
Microsoft Download Center
Microsoft Evaluation Center
Drivers
Windows Sysinternals
TechNet Gallery
Training
Expert-led, virtual classes
Training Catalog
Class Locator
Microsoft Virtual Academy
Free Windows Server 2012 courses
Free Windows 8 courses
SQL Server training
Microsoft Official Courses On-Demand
Certifications
Certification overview
Special offers
MCSE Cloud Platform and Infrastructure
MCSE: Mobility
MCSE: Data Management and Analytics
MCSE Productivity
Other resources
Microsoft Events
Exam Replay
Born To Learn blog
Find technical communities in your area
Azure training
Official Practice Tests
Support options
For business
For developers
For IT professionals
For technical support
Support offerings
More support
Microsoft Premier Online
TechNet Forums
MSDN Forums
Security Bulletins & Advisories
Not an IT pro?
Microsoft Customer Support
Microsoft Community Forums
Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - Page Details
First published by
Markus Vilcinskas
(Microsoft)
When:
12 Jan 2011 3:48 AM
Last revision by
Durval Ramos
When:
23 May 2014 6:15 PM
Revisions:
11
Comments:
4
Options
Subscribe to Article (RSS)
Share this
Engage!
Wiki Ninjas Blog
(
Announcements
)
Wiki Ninjas on Twitter
TechNet Wiki Discussion Forum
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
How to Use PowerShell to Check Your MPR Configuration for FIM Portal Access
How to Use PowerShell to Check Your MPR Configuration for FIM Portal Access
Article
History
How to Use PowerShell to Check Your MPR Configuration for FIM Portal Access
FIM ScriptBox Item
Summary
Note
Please see
this post
for more details.
Script Code
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
#----------------------------------------------------------------------------------------------------------
set-variable
-name
URI
-value
"http://localhost:5725/resourcemanagementservice"
-option
constant
#----------------------------------------------------------------------------------------------------------
if
(
@(
get-pssnapin
|
where-object
{
$_
.
Name
-eq
"FIMAutomation"
}
)
.
count
-eq
0
)
{
add-pssnapin
FIMAutomation
}
$mprNames
=
@(
)
$mprNames
+=
”General: Users can read non-administrative configuration resources”
$mprNames
+=
“User management: Users can read attributes of their own”
#----------------------------------------------------------------------------------------------------------
write-host
"Checking MPRs"
write-host
"============="
foreach
(
$mprName
in
$mprNames
)
{
write-host
$mprName
$curMpr
=
export-fimconfig
-uri
"http://localhost:5725/resourcemanagementservice"
`
-customconfig
(
"/ManagementPolicyRule[DisplayName='$mprName']"
)
`
–onlyBaseResources
`
-ErrorVariable
Err
`
-ErrorAction
SilentlyContinue
if
(
$Err
)
{
throw
$Err
}
if
(
$curMpr
-eq
$null
)
{
throw
"MPR not found!"
}
$isDisabled
=
$curMpr
.
ResourceManagementObject
.
ResourceManagementAttributes
|
`
Where-Object
{
$_
.
AttributeName
-eq
"Disabled"
}
if
(
$isDisabled
.
Value
-eq
$true
)
{
write-host
"Enabled: No`n"
-foregroundcolor
yellow
-backgroundcolor
black
}
else
{
write-host
"Enabled: Yes`n"
}
}
write-host
"`nCommand completed successfully`n"
#----------------------------------------------------------------------------------------------------------
trap
{
Write-Host
"`nError: $($_.Exception.Message)`n"
-foregroundcolor
white
-backgroundcolor
darkred
Exit
1
}
#----------------------------------------------------------------------------------------------------------
Note
To provide feedback about this script, create a post on the
FIM TechNet Forum
.
For more FIM related Windows PowerShell scripts, see the
FIM ScriptBox
.
See Also
PowerShell Portal
Wiki: Portal of TechNet Wiki Portals