Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjrobinson/b7dc0df1c3eeee9c4e7980db05825855 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/b7dc0df1c3eeee9c4e7980db05825855 to your computer and use it in GitHub Desktop.
Gets the Last FIM/MIM MA Run Details, finds the errors associated with Objects that need deleting and deletes them
import-module LithnetMIISAutomation
$lastrun = Get-LastRunDetails -MA "MIM Service"
$errors = $lastrun.StepDetails.SynchronizationErrors
foreach ($cserror in $errors.ExportErrors){
if ($cserror.ErrorType -eq "failed-creation-via-web-services"){
$objDN = $cserror.DN
write-host "DN: " $objDN
Get-CSObject -DN $objDN -MA "MIM Service" | Disconnect-CSObject
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment