what if you loop 'Registry::\HKEY_USERS*', and save each GUID,
then for each one , check if the key you wan exist, if exist , replace it with your own one.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I'm going registry because when I do a backup-GPO with Powershell in Windows Server 2022, and restore it in a different server it does not restore the Network Manager List - Network Name Value (which is TEST in this case).
I want to find a registry key, get its property, then replace its value's content.
The command
Get-ChildItem -Recurse 'Registry::\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\' | Where-Object -Property Property -eq 'NetworkName'
has the following result (result added to table for clarity)
Hive: \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\HOME.LAB{4EC0F00B-201C-4797-932D-6EF1CC21C6D0}Machine\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures
Name | Property |
---|---|
010103000F0000F0A00000000F0000F086168AABAC5FC2C5CBAB3F047448 CC865A0B7C51543E20F1D32F866F295385D5 | NetworkName : TEST |
010103000F0000F0A00000000F0000F0B1DB637718FD006EEA6B7AEC531D 8D388D1EA0C6253C23FA568CFED3E89A851E | NetworkName : TEST |
Hive: \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\HOME.LAB{9F735890-5835-41F2-96DB-41D1A1105B67}Machine\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures
Name | Property |
---|---|
010103000F0000F0A00000000F0000F086168AABAC5FC2C5CBAB3F047448CC865A0B7C51543E20F1D32F866F295385D5 | NetworkName : TEST |
If I use Get-ItemPropertyValue
to get the exact value I can replace the value with Set-ItemProperty
but I need to have an absolute path, but the path is dynamic as it contains GUID.
Get-ItemPropertyValue 'Registry::\HKEY_USERS\S-1-5-21-282977542-1070382683-59601606-500\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\HOME.LAB{4EC0F00B-201C-4797-932D-6EF1CC21C6D0}Machine\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\010103000F0000F0A00000000F0000F086168AABAC5FC2C5CBAB3F047448CC865A0B7C51543E20F1D32F866F295385D5' -Name NetworkName
TEST
How to find all keys with a value of TEST, and replace them with my own name ?, the TEST is the value I need to replace.
Thank You
what if you loop 'Registry::\HKEY_USERS*', and save each GUID,
then for each one , check if the key you wan exist, if exist , replace it with your own one.
Thanks for the reply,
How do I capture the GUID part of it ?