none
how to delete account unknown user profile RRS feed

  • Question

  • Dear Team,

    we have Windows server 2008 R2.

    So many Account Unknown user profile created. now we need to delete all "Account Unknown" only.

    any comment or batch file available for this ?


    Regards, Pradhap P

    Friday, July 5, 2019 7:31 AM

All replies

  • Hi,

    try powershell Get-Localuser -> what does it say ? You can export the data into CSV by

    Get-localuser | Export-csv "C:\Scripts\Localusers-export.csv" -delimeter ";" 

    My Idea is:

    1. Copy all the unknown user accounts (or IDs) into one .txt File

    2. create PS-Script, for example like:

    $Accountstodelete = Get-Content "C:\Scripts\Localusers-export.csv" 

    foreach ($account in $Accountstodelete)

    {

    Remove-Localuser -Name $account

    }

    regards, pat

    Friday, July 5, 2019 6:13 PM
  • hi,
    there is a document for your reference.
    How to delete unknown accounts in groups on a terminal server?
    https://community.spiceworks.com/topic/1998329-how-to-delete-unknown-accounts-in-groups-on-a-terminal-server

    Please Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.


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


    Monday, July 8, 2019 11:02 AM
    Moderator
  • hi,
    Is there any progress on your question?

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

    Friday, July 12, 2019 1:44 AM
    Moderator
  • hi,
    Is there anything to help you?

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

    Monday, July 15, 2019 3:56 AM
    Moderator
  • HI
    Have you solved your problem?If you have solved a problem using our solution, please "mark it as an answer" to help other community members quickly find useful responses.

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

    Monday, July 29, 2019 3:09 PM
    Moderator