Check which users are editing profile details

Published by AJ Alacan on

I had to create a report to list which users are edting their profiles. Im not going to list all the details, but i created this PS script. You might have to change MySite URL and start date.

$mysiteHostUrl = “http://mysite”

$mysite = Get-SPSite $mysiteHostUrl

$context = [Microsoft.Office.Server.ServerContext]::GetContext($mysite)

$manager =  New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

$query = New-Object Microsoft.Office.Server.UserProfiles.UserProfileChangeQuery $false,$false
$query.Add = $query.Update = $query.SingleValueProperty = $true
$query.ChangeTokenStart = New-Object Microsoft.Office.Server.UserProfiles.UserProfileChangeToken ([System.DateTime]”7/1/2013″)

$query

$manager.GetChanges($query) | ft ChangeType,ObjectType,@{Expression={$_.ProfileProperty.Name};Label=”Property”},NewValue -GroupBy AccountName > C:\profileChanges.txt

 

 

Categories: