How to restore local accounts on win10

Anthony Czarnik 6 Reputation points
2020-12-23T12:11:30.44+00:00

I deployed powershell logic to remove stale profiles from workstations.

the logic had the HKLM path to the profilelist keys in a static string, with a $variable at the end containing the SID of the target key to remove. in the situation where a user had a temp account, and a normal account, the SID was not found and the variable would be blank, therefore removing all the SIDs in the profilelist. I managed to learn .NET overnight to regenerate them by running a powershell script from my computer that connected to the remote registry service, using profileGUID to get the SIDs, and AD to translate those SIDS into usernames, then user profile folder paths.

This is great, but the .NET accounts are now missing. Can I simply uninstall-reinstall .NET to restore those accounts?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,617 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Reza-Ameri 16,831 Reputation points
    2020-12-23T17:14:26.76+00:00

    Are you using those .NET accounts?
    You could recreate them or create new account and set rules the way you want.
    There is comment in PowerShell called Remove-LocalUser and you may use it to remove user account which is much easier than removing them from registry.


  2. S.Sengupta 15,111 Reputation points MVP
    2020-12-24T05:03:45.787+00:00

    After you remove a capability SID, you cannot use the UI to add it back.

    0 comments No comments