I have a problem when loading a UserProfile
from the UserProfileService
in Powershell
. I am able to get a list of properties, however I can't seem to find when the profile was last modified.
One property that appears close is CurrentChangeToken
however for all of my user profiles it is 1;28208;03/18/2014 02:00:00
which is a few hours before I ran the script.
$siteUrl = "http://intranet/"
$site = Get-SPSite $siteUrl
$context = Get-SPServiceContext($site)
$pm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
$allUsers = Get-SPUser -Web $siteUrl
$allUsers = $allUsers | Where-Object { $_.UserLogin -like "*DOMAIN*" }
$resultsArray =@()
foreach($user in $allUsers)
{
if($pm.UserExists($user.UserLogin))
{
$userProfile = $pm.GetUserProfile($user.UserLogin)
}
}
Does anyone know how I can get the last modified date of each User Profile?