none
“Profiles Missing from Import” not appearing in “-GetNonImportedObjects” Results

    Frage

  • I have a number of user profiles that appear in my "Profiles Missing From Import" screens in CA (for operational reasons, we have disabled the Profile cleanup service, and are now investigating our own scripted replacement).

    When I attempt to identify those same profiles using switch:

    -GetNonImportedObjects

    ...in PowerShell, I get a far shorter list. This is clearly wrong - I can verify accounts that have been disabled in AD which still have an outstanding user profile in SharePoint, and they are not appearing in these PowerShell results.

    Does anyone know why this might be? Or how I can identify and remove these accounts using PowerShell?

    Mittwoch, 13. Juni 2018 14:47

Alle Antworten

  • Hi Alex,

    Could you please have a look of below MSDN blog post to remove them using Powershell command.

    https://blogs.technet.microsoft.com/spjr/2017/09/24/sharepoint-all-about-non-imported-user-profiles/

    Hope this will help you.

    Best Regards,

    Soni K

    Mittwoch, 13. Juni 2018 15:04
  • Thanks, Soni.

    However, this is a variation of the same problem. Essentially, this PowerShell command isn't bringing back the correct array of results.

    For example:

    • We have a user with the surname "Evans", who left the business last year
    • The user account was removed in Active Directory
    • If I search for this person under "Profiles Missing From Import" in the User Profile service application in Central Admin console, then the user profile appears in the search results, and I can see everything about the profile; this user's MySite is also still visible
      - (as a side point, there are many profiles that match this criteria)
    • However, when I run the command "$upa -GetNonImportedObjects $true", a far shorter list of results is returned - and the user account that I was able to see in the "Profiles Missing From Import" screen in Central Admin console doesn't appear in this list.

    Can anyone advise why this is? And how to get a list of all of the inactive/disabled/non-imported accounts using Powershell?


    • Bearbeitet Alex SPAD Mittwoch, 13. Juni 2018 15:23
    Mittwoch, 13. Juni 2018 15:23
  • Hi Alex,

    User profiles in "Profile missing from import" view means, these user profiles are not imported(incorrectly) and marked for deletation which have been existed in user profile database, "GetNonImportedObjects=true" should mean get the nonimported user profiles from user profile databas as self-descriptive.

    Below articles tell more information about how to Find Inactive AD User Accounts using Powershell, which may be helpful to you:

    https://www.morgantechspace.com/2015/02/find-inactive-ad-users-with-powershell.html

    https://www.petri.com/using-powershell-to-find-disabled-or-inactive-user-accounts-in-active-directory

    If you want to remove the inactive profiles, you can use below commands:

    $upa = Get-SPServiceApplication -id <Identity of User Profile Service Application>
    Set-SPProfileServiceApplication -Identity $upa – PurgeNonImportedObjects $true

    Best regards,

    Allen Bai



    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Donnerstag, 14. Juni 2018 06:53
  • Thank you for your input, Allen.

    Identifying profiles that are inactive in Active directory isn't really what I'm looking for - I'm trying to find all of the user profiles in SharePoint that show up in the "Profiles Missing From Import" view - i.e., as you have rightly pointed out, profiles marked for deletion.

    The "nonImportedObjects" switches (either "GetNonImportedObjects" or "PurgeNonImportedObjerts") don't reveal these accounts.

    I need a Powershell command which does reveal them.

    What script will achieve this?

    Donnerstag, 14. Juni 2018 08:12
  • Hi Alex,

    To view list of all obsolete users, run the below PowerShell ( give the identity of user profile):

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

    Best regards,

    Allen Bai


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Freitag, 15. Juni 2018 02:32
  • Hi Allen,

    Thank you for coming back to me again.

    Unfortunately, as discussed earlier, this command doesn't bring back the entire list of profiles. Allow me to explain:

    For example:

    • We have a user with the surname "Evans", who left the business last year
    • The user account was removed in Active Directory
    • If I search for this person under "Profiles Missing From Import" in the User Profile service application in Central Admin console, then the user profile appears in the search results, and I can see everything about the profile; this user's MySite is also still visible
       - (as a side point, there are many profiles that match this criteria)
    • However, when I run the command "$upa -GetNonImportedObjects $true", a far shorter list of results is returned - and the user account that I was able to see in the "Profiles Missing From Import" screen in Central Admin console doesn't appear in this list.

    I'm trying to find all of the user profiles in SharePoint that show up in the "Profiles Missing From Import" view - i.e., as you have rightly pointed out, profiles marked for deletion.

    I have tried many different variations on the PowerShell script that you provided, but it doesn't return all of the users marked for deletion. Do you know why?

    Freitag, 15. Juni 2018 06:41