Jump to content

Recommended Posts

Posted

Hi,

 

I've come up against a problem whereby Windows 10 will not update unless I remove the SIDs from the following location:

 

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore

 

I'd like to remove all SIDs beginning with S-1-5-21

 

If at all possible it'd be fantastic if all SIDs could be removed apart from any that are present in the below location:

 

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

 

It's not a deal breaker though if that can't be achieved. I really haven't a clue where to start with this one.

Posted

I've solved the first bit:

 

Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore" | Where {$_.Name -like "*S-1-5-21*"} | Remove-Item -Recurse

 

That does remove all SIDs in that location. It'd be nice if I could leave the SIDs in that are located in the ProfileList too.

Posted

If you grab a list of the SIDs you want to skip you should be able to add a filter to Where-Object:

 

$SIDsToSkip = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' | Select -ExpandProperty PSChildName

Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore" |
   Where {$_.Name -like "*S-1-5-21*" -and $_.PSChildName -notin $SIDsToSkip}

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...