Microsoft Tech Net Link
http://social.technet.microsoft.com/wiki/contents/articles/22814.fim-portals-use-powershell-showing-number-of-sets-a-user-is-a-member-of.aspx
http://social.technet.microsoft.com/wiki/contents/articles/22814.fim-portals-use-powershell-showing-number-of-sets-a-user-is-a-member-of.aspx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FIM Portals: PowerShell Showing number of SETs a User Is a Member Of | |
$User = Read-Host "Enter the user display name" | |
if(@(Get-PSSnapin | ? { $_.Name -eq "FIMAutomation" } ).Count -eq 0) | |
{ | |
Add-PSSnapin FIMAutomation; | |
} | |
$Sets = Export-FIMConfig -customConfig '/Set' -Uri "http://localhost:5725" -OnlyBaseResources | |
foreach ($Set in $Sets) | |
{ | |
foreach($i in (($Set.ResourceManagementObject.ResourceManagementAttributes | Where-Object {$_.AttributeName -eq "DisplayName"}).Value) ) | |
{ | |
$Member = Export-FIMConfig -customConfig "/Person[ObjectID = /Set[DisplayName = '$i']/ComputedMember]" -Uri "http://localhost:5725" -OnlyBaseResources | |
foreach($Mem in $Member) | |
{ | |
$y=(($Mem.ResourceManagementObject.ResourceManagementAttributes | Where-Object {$_.AttributeName -eq "DisplayName"}).Value) | |
if($y -eq $User) | |
{ | |
Write-Host "$i" | |
} | |
} | |
} | |
} | |
No comments:
Post a Comment