| |
Summary |
| |
To access the FIM portal, the following attributes must be set:
- AccountName
- Domain
- ObjectSID
This script lists the values of these attributes for a user. The script indicates if a value is not set:

If the values are set, the script shows them:

|
#----------------------------------------------------------------------------------------------------------
set-variable -name URI -value "http://localhost:5725/resourcemanagementservice" -option constant
set-variable -name DisplayName -value "Britta Simon" -option constant
#----------------------------------------------------------------------------------------------------------
Function SetAttributeValue
{
Param($DataRecord, $CurObject, $AttributeName)
End
{
$CurAttribute = $curObject.ResourceManagementObject.ResourceManagementAttributes | `
Where-Object {$_.AttributeName -eq "$AttributeName"}
If($curAttribute -eq $null)
{$DataRecord | Add-Member NoteProperty $AttributeName ""}
Else
{$DataRecord | Add-Member NoteProperty $AttributeName $($CurAttribute.Value)}
}
}
#----------------------------------------------------------------------------------------------------------
If(@(get-pssnapin | where-object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {add-pssnapin FIMAutomation}
#----------------------------------------------------------------------------------------------------------
$CurObject = export-fimconfig -uri $URI `
–onlyBaseResources `
-customconfig ("/Person[DisplayName='$DisplayName']")`
-ErrorVariable Err `
-ErrorAction SilentlyContinue
If($Err){Throw $Err}
If($CurObject -eq $null) {throw "User not found"}
$DataRecord = New-Object PSObject
SetAttributeValue -DataRecord $DataRecord -CurObject $CurObject -AttributeName "AccountName"
SetAttributeValue -DataRecord $DataRecord -CurObject $CurObject -AttributeName "DisplayName"
SetAttributeValue -DataRecord $DataRecord -CurObject $CurObject -AttributeName "Domain"
SetAttributeValue -DataRecord $DataRecord -CurObject $CurObject -AttributeName "ObjectSID"
Clear-Host
$DataRecord | Format-List
#----------------------------------------------------------------------------------------------------------
trap
{
Write-Host "`nError: $($_.Exception.Message)`n" -foregroundcolor white -backgroundcolor darkred
Exit 1
}
#----------------------------------------------------------------------------------------------------------
Markus Vilcinskas, Knowledge Engineer, Microsoft Corporation