Who has Not Registered for SSPR


The Following script can be used to determine who has not Registered for Self Service Password Reset for Forefront Identity Manager 2010 R2 Special thanks to Markus Vilcinskas

The Following script was inspired by Mr. Vilcinskas posted script http://social.technet.microsoft.com/wiki/contents/articles/3616.how-to-use-powershell-to-export-all-users-who-have-registered-for-self-service-password-reset-sspr.aspx

set-variable -name URI -value “http://localhost:5725/resourcemanagementservice’ ” -option constant

set-variable -name CSV -value “NotRegistredResetPassUsers.csv”

clear

If(@(Get-PSSnapin | Where-Object {$_.Name -eq “FIMAutomation”} ).count -eq 0) {Add-PSSnapin FIMAutomation}

$WFDFilter = “/WorkflowDefinition[DisplayName=’Password Reset AuthN Workflow’]”

$curObjectWFD = export-fimconfig -uri $URI –onlyBaseResources -customconfig ($WFDFilter) -ErrorVariable Err -ErrorAction SilentlyContinue

$WFDObjectID = (($curObjectWFD.ResourceManagementObject.ResourceManagementAttributes | Where-Object {$_.AttributeName -eq “ObjectID”}).value).split(“:”)[2]

$Filter = $Filter = “/Person[not(AuthNWFRegistered = ‘9c3aca59-a85c-437f-bb67-9ce5a70521d7’)]”

$curObject = export-fimconfig -uri $URI –onlyBaseResources -customconfig ($Filter) -ErrorVariable Err -ErrorAction SilentlyContinue

[array]$users = $null

foreach($Object in $curObject)

{

 $ResetPass = New-Object PSObject

 $UserDisplayName = (($Object.ResourceManagementObject.ResourceManagementAttributes | Where-Object {$_.AttributeName -eq “DisplayName”}).Value)

 $ResetPass | Add-Member NoteProperty “DisplayName” $UserDisplayName

 $Users += $ResetPass

}

$users | export-csv -path $CSV

 

## http://blogs.msdn.com/connector_space ##

NotRegistredResetPassUsers.ps1

Comments (2)

  1. Shim says:

    Hi, this scripts fails with the following error:

    export-fimconfig : Failure on making enumeration web service call.
    Filter = /WorkflowDefinition[DisplayName=’Password Reset AuthN Workflow’]
    Error= Microsoft.ResourceManagement.WebServices.Faults.ServiceFaultException: cannot filter as requested
    at Microsoft.ResourceManagement.WebServices.Client.ResourceTemplate.EnumerateResources(SearchParameters parameters,
    ClientOptionsHelper clientOptionsHelper)
    at Microsoft.ResourceManagement.WebServices.ResourceManager.MoveNext()
    at Microsoft.ResourceManagement.Automation.ExportConfig.EndProcessing()
    At line:11 char:17
    + $curObjectWFD = export-fimconfig -uri $URI –onlyBaseResources -customconfig ($WF …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Export-FIMConfig], InvalidOperationException
    + FullyQualifiedErrorId : ExportConfig,Microsoft.ResourceManagement.Automation.ExportConfig

    You cannot call a method on a null-valued expression.
    At line:13 char:1
    + $WFDObjectID = (($curObjectWFD.ResourceManagementObject.ResourceManagementAttrib …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    export-fimconfig : Failure on making enumeration web service call.
    Filter = /Person[not(AuthNWFRegistered = ‘9c3aca59-a85c-437f-bb67-9ce5a70521d7’)]
    Error= Microsoft.ResourceManagement.WebServices.Faults.ServiceFaultException: cannot filter as requested
    at Microsoft.ResourceManagement.WebServices.Client.ResourceTemplate.EnumerateResources(SearchParameters parameters,
    ClientOptionsHelper clientOptionsHelper)
    at Microsoft.ResourceManagement.WebServices.ResourceManager.MoveNext()
    at Microsoft.ResourceManagement.Automation.ExportConfig.EndProcessing()
    At line:17 char:14
    + $curObject = export-fimconfig -uri $URI –onlyBaseResources -customconfig ($Filte …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Export-FIMConfig], InvalidOperationException
    + FullyQualifiedErrorId : ExportConfig,Microsoft.ResourceManagement.Automation.ExportConfig

    1. I will review it this week, quite often the scripts are negatively converted when copied or pasted in or from the blog.. Are you using PowerShell ISE?

Skip to main content