Starting from 2008R2 ADDS introduce a PowerShell module for managing GPO called “GroupPolicy”. In this module there is a cmdlet called Set-GPRegistryValue this type of policy can configure registry-based Policy.
With the settings collected from the LGPO I’m able to use this cmdlet to set the 700 Urls:
=====================================================
Read Urls from a file on disk.
$Urls = get-Content .Urls.txt
Build a loop to add all the Urls to the specified CPO.
foreach ($Url in $Urls)
{
Set-GPRegistryValue -Name ListBoxGPO -ValueName $Url -Type String -Value $Url -Key “HKLMSOFTWAREPoliciesMicrosoftWindowsCurrentVersionInternet SettingsRestrictedProtocols1”
}
=====================================================
Verify correct execution of the script by editing the GPO from the GPMC and check the content of the Listbox:
Hope this information can help you
Best wishes
Vicky
Also, note that you may find it easier to use Group Policy Preferences (Registry) to create/populate/manage these registry values, rather than the classic Admin Templates.
e.g., you could populate the registry keys/names/values in a PC (via script or whatever), and then use GPP-Registry to "import" those keys/names/values into a GPP GPO, and use that GPO to deploy the settings in your environment.
Hi @DonPick ,
Thank you for your answer.
I created the key and I I followed the post below, but it doesn't work...
https://techcommunity.microsoft.com/t5/itops-talk-blog/tough-questions-answered-how-to-add-multiple-values-to-a-gpo/ba-p/375750
There is no any content on the listbox... :(
examine the registry key directly, by using regedit, to confirm if your script has executed correctly?
Or, consider using the GPP-Registry instead (use GPP-Registry don't use the AdminTemplate)
The blog you have linked, seems to be the source of the advice presented previously from VickyWang. You can choose either of these methods, but they deliver the same result to the registry.
Hello,
I examined the registry key directly by using regedit but I mean the script has not executed correctly, there is no any urls in the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\CookiesAllowedForUrls.
And the listbox in the GPO settings the urls are not added...
However I followed the steps of the blogs and it doesn't work. How can I do by using GPP?
By advance thank you very much.
Mohamed
Sign in to comment