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
Tim Macaulay
(bMicrosof)
When:
22 Oct 2012 2:05 PM
Last revision by
dplotnikov - mvp
(cMV)
When:
29 Jul 2013 11:48 PM
Revisions:
9
Comments:
0
Options
Subscribe to Article (RSS)
Share this
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 delete an orphaned Synchronization Rule in FIM
How to use PowerShell to delete an orphaned Synchronization Rule in FIM
Article
History
How to use PowerShell to delete an orphaned Synchronization Rule in FIM
Table of Contents
Overview
Resolution
Overview
Recently, I worked on an issue to where we had a Synchronization Rule that had become orphaned in the FIM Portal. If a Synchronization Rule becomes orphaned, then:
You will not be able to delete the Synchronization Rule
You will receive the error message "Unable to process your request" when attempting to view the Properties
Our goal here is that we need to discover a way to remove the Synchronization Rule from the FIM Portal without affecting anything else.
ORPHANED SYNCHRONIZATION RULE
: You can get an Orphaned Synchronization Rule if you delete the corresponding Management Agent prior to deleting the Synchronization Rule.
Resolution
To resolve the issue, I put together the following PowerShell script that will loop through the Synchronization Rules and then delete the Synchronization Rule.
########################################################################################################################
###
### FIM_Support-DeleteSynchronizationRule
######
### PURPOSE: Designed to locate a Synchronization Rule based on DisplayName and/or the ResourceID of the Synchronization Rule
### PARAMETERS:
### $URI = FIM Web Service Address and port ( e.g.
http://myfimservice:5725
)
### $GETDISPLAYNAME = Synchronization Rule Display Name of the Synchronization Rule you wish to delete
### $TARGETIDENTIFIER = ResourceID of the Synchronization Rule you wish to delete
###
########################################################################################################################
PARAM
(
$uri
,
[
string
]
$GetDisplayName
,
[
string
]
$TargetIdentifier
)
if
( (
Get-PSSnapin
-Name
FIMAutomation
-ErrorAction
SilentlyContinue
)
-eq
$null
) {
Add-PsSnapin
FIMAutomation
}
$uri
=
$uri
+
"/resourcemanagementservice"
$exportData
=
export-fimconfig
-uri
$uri
-customconfig
(
"/SynchronizationRule"
)
-onlyBaseResources
$exportData
|
ForEach-Object
{
$displayName
=
(
$_
.
ResourceManagementObject
.
ResourceManagementAttributes
|
`
Where-Object
{
$_
.
AttributeName
-eq
"DisplayName"
})
.
Value
if
(
$displayName
-eq
$GetDisplayName
){
$TargetIdentifier
=
(((
$_
.
ResourceManagementObject
.
ResourceManagementAttributes
|
Where-Object
{
$_
.
AttributeName
-eq
"ObjectID"
})
.
Value)
.
Split(
":"
))
[
2
]
}
$importObject
=
New-Object
Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
$importObject
.
ObjectType
=
"SynchronizationRule"
$importObject
.
TargetObjectIdentifier
=
$TargetIdentifier
$importObject
.
SourceObjectIdentifier
=
$TargetIdentifier
$importObject
.
State
=
2
$importObject
|
Import-FIMConfig
-uri
$uri
-ErrorAction
SilentlyContinue
}
DELETE SYNCHRONIZATION RULE
,
FIM
,
FIM 2010
,
FIM How To Script
,
FIM Resources
,
FIM-HELP
,
FIM-HOWTO
,
MIISILMFIM MACAULAY
,
SYNCHRONIZATION RULE
[Edit tags]
Leave a Comment
Please add 4 and 5 and type the answer here:
Post
Wiki - Revision Comment List(Revision Comment)
Wikis - Comment List