I'm looking into an issue where employees that have already had their accounts decommissioned in Active Directory are displaying in our new starters and birthday web parts after they have left the company.

I believe that this holds the answer: http://technet.microsoft.com/en-us/library/ff681014(v=office.15).aspx#disabledUsers

Specifically, using the following:

$upa = Get-spserviceapplication <identity>
Set-SPProfileServiceApplication $upa -GetNonImportedObjects $true
Set-SPProfileServiceApplication $upa -PurgeNonImportedObjects $true

However I don't know how to find the GUID of the User Profile Service - how do I go about this?

2 Answers 2


Run the below command to get the GUID of the User Profile Service.

$upaSAType = "User Profile Service Application"

$upa = Get-SPServiceApplication | where-object {$_.TypeName -eq $upaSAType}


Get-SPServiceApplication -Name "User Profile Service Application"


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.