If you have been managing Internet Explorer for years, perhaps your organization has provided predefined favorites to the users by populating a subfolder in the Favorites folder.
Now you are preparing to migrate to the chromium based Edge browser, and you would like to take advantage of the Group Policy setting “Configure Favorites” to prepopulate some favorites, like the users have been used to.
(In Google Chrome the same setting is called “Managed Bookmarks”)
This Group Policy setting requires a JSON formatted text string, where the favorites / bookmarks are defined.
But how do you get from a Favorites folder with one .URL file for each favorite to a JSON string, that you can insert in the Group Policy setting?
Here’s a script to automate the proces for you
How the script works is described in the Synopsis of the script, so to avoid a lot of redundant text, please read it there :)
You can run the script as is without input parameters and without changing the following variables.
In that case it will:
Read the favorites from %USERPROFILE%\Favorites ($IEFavoritesPath)
Name the Managed Favorites / Bookmarks folder in the browser “IE Favorites” ($bookmarksTopLevelName)
Output the JSON formatted text string to %USERPROFILE%\Documents\ManagedBookmarks.txt ($JSONFile)
After the file creation, simply copy the contents of the file and insert in the Group Policy setting.
Be aware of the limitation in the JSON string length
The limitation is not in the script, but in the ADMX policy and in registry.
For the same reason, the script does not traverse large hierachies, but only one level of subfolders.
The Group Policy setting simply isn’t capable of huge amounts of favorites/bookmarks.
The limit depends on the length of both the URLs and the names of the favorites / bookmarks.
If the Group Policy Editor simply doesn’t allow you to paste the string in, then you have hit the limit ;)
But please test, because I have experienced, that I’m allowed to paste in the string, but Chrome still does not show the bookmarks.
For me, the limit was somewhere between 37254 and 41099 characters in the string.
credits
I have based the part that reads data from the .URL files from a function created by Oliver Lipkau
Get-IniContent script on Technet Gallery
the script: