So if you have a large number of objects to update in FIMService it could be complicated..
Lithnet FIM/MIM Powershell Module makes it so much simpler..
Below is a script I used to say update all accounts which have “accountType” = oldaccounts and set “accountBlocked” to true (my custom schema).
- I have set PageSize = 100 which means if you are returning more than that number process only 100 at a time..
- I have set “-AttributesToGet” which gives me only the attribute what I want
$objs = Search-ResourcesPaged -XPath "/Person[(accountType = 'oldaccounts')]" -AttributesToGet accountBlocked
$objs.PageSize = 100
$i = 0
$results = $objs.GetNextPage();
foreach ($user in $results)
$user.accountBlocked = $true
Write-Host "Saved $i of " $objs.TotalCount
See how easy is that? You can do multiple operations before save-resource and thus do a bunch of changes to say 1000 users and in 10 saves it will be done!!!
PS: As you can see its simple for demonstration and not doing any error handling etc..