Quantcast
Channel: Microsoft Identity Manager forum
Viewing all articles
Browse latest Browse all 7443

Using Powershell to export all users have registered for Self-Service Password Reset (SSPR)

$
0
0
  Summary
 

This script lists the Display Name of users that were already registered into the FIM Portal by FIM Password Reset Registration Client and export it to a CSV File.
The script queries a WorkFlow called "Password Reset AuthN Workflow" and returns its ObjectID, then use it to do a new query searching for "Users" with these parameters:
AuthN WorkFlow Registered = ObjectID of "Password Reset AuthN Workflow"

 

set-variable -name URI -value "http://localhost:5725/resourcemanagementservice' " -option constant set-variable -name CSV -value "RegistredResetPassUsers.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 = "/Person[AuthNWFRegistered = '$WFDObjectID']"

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

[array]$users = $nullforeach($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

 

 Go to the FIM ScriptBox

***** Paulo H. Campos - São Paulo/Brasil ***** http://identitypedia.blogspot.com (in PT-BR)

Viewing all articles
Browse latest Browse all 7443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>