I need to find all the subkeys with a specific value say C:\users\108736 then change that value to c:\users\108735
my real issue is I have to remove folder redirection on all my users machines so I need to change all the registry values that point to remote drives to point back to local I have the script 90% complete but the are some random registry keys I need to find and change with the script
So you need to search the _entire registry_ to do this? That's going to be massively impractical.
But, it isn't syntactically difficult. In pseudo-code...
Get-ChildItem HKCU:\Whatever\Starting\Kay -Recurse |
# Get the item properties |
Where value -like 'whatever' |
That's very obviously not running code, but it's the basic logic you could start with. Get all the keys, enumerate them. For each one, key its properties. For each of those, see which ones have a value you care about, and change the value.
yup I ditched the idea. I just opted to change the main keys that impact production the other key like MSoffice History will be cleared manually. my new issue is how to reset the ACL on the files when I move them back from the cached folder to there profile.