We have a program that holds an address in a REG_SZ, it's a real pain in the bum to setup the address for all our users.
I am trying to use group policy preferences to set this address, however, when GPP applies the registry key, the newline characters seem to be replaced with spaces. So instead of this:
123 Street Road
123 Street Road Suburb City 45678
Is there any way I can get GPP to apply the registry key correctly?
The smart way for this is to use the registry type REG_MULTI_SZ instead of REG_SZ.
I'd try if your app can cope with this.
If not I would create a reg export of the key created by the app itself.
How does it look like? Maybe your app supports escape sequences, e.g. \n for Linefeed?
See if you can use this string within GPP.
All good ideas, unfortunately I have tried all of them. This program doesn't like REG_MULTI_SZ, only REG_SZ by the look of it.
It doesnt like escape characters either...
To import the key correctly, the reg file has to look like the following:
That will read:
This seems to be the only way to import a REG_SZ with the newline characters. But I would really like to use GPP for this. We already have enough scripts without adding another into the mix to test what branch the user is in and import the correct reg file. We have near 100 branches.
If someone from Microsoft can confirm that its not possible. That would be nice :-), we can go back to manually adding it :-(.
I'd agree there is a limitation in GPP Editor. You cannot insert LF characters here.
But try this trick:
Open the file "Registry.xml" on SYSVOL share with an editor (path = ...\Policies\GUIDofYourGPO)
Navigate to your item and use the XML escape sequence
as delimiter between your lines.
At least when reading the result from registry via vbcsript I get a multiline result.
Don't know what your app makes out of this, but give it a try...