UserProfile Properties in SharePoint 2013

UserProfileProperties is a newly introduced feature in SharePoint 2013.  In this blog, we will see how to get user profile details in SharePoint 2013 environment using Powershell Commands.
 
$PeopleManager = New-Object Microsoft.SharePoint.Client.UserProfiles.PeopleManager($Context)
Foreach ($User in $Users)
{
$UserProfile = $PeopleManager.GetPropertiesFor($User.LoginName)
$Context.Load($UserProfile)
$Context.ExecuteQuery()
If ($UserProfile.Email -ne $null)
{
$UPP = $UserProfile.UserProfileProperties
Write-Host UserProfile.DisplayName
Write-Host UserProfile.PersonalUrl
Write-Host $UPP.WorkPhone
Write-Host $UPP.Department
 
Happy SharePointing :-)