Thursday, 6 June 2013

PowerShell to Query groups having no owners in FIM portal

<# Please do not anything in the production enviroment unless and untill you are very much sure #>
# Load FIMAutomation module
 if(@(Get-PSSnapin | ? { $_.Name -eq "FIMAutomation" } ).Count -eq 0)
 {
     Add-PSSnapin FIMAutomation;
 }
$groups = Export-FIMConfig -customConfig "/Group[Owner !=/Person]" -Uri "http://localhost:5725"  -OnlyBaseResources
foreach ($group in $groups)
{
$x = (($group.ResourceManagementObject.ResourceManagementAttributes | Where-Object {$_.AttributeName -eq "DisplayName"}).Value)
Write-Host "Groups are $x"
}

No comments:

Post a Comment

..Love

Born as Mathematician, Found love in Scripting and want to have an affair with C#

Total Pageviews