Home > Windows > Insert system variables into registry via GPO

Insert system variables into registry via GPO

I’m implementing RDS (TS) farm at one of our customers. From my previous experiences I love to have %USERNAME% and %COMPUTER% name variables in name od Computer on RDS User’s Desktop.

I’ve created GPO which filles registry key (REG_EXPAND_SZ):

HKEY_CLASSES_ROOT\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\LocalizedString

with following string:

%USERNAME% at %COMPUTERNAME%

This looked enought for me to be happy. But when I looked at one computer called HPTS01 I found out that computer’s name was changed to HPTS01$ at HPTS01 🙂 Which was not what I wanted to accomplish. I started to looking for a solution how to put just a “string” into registry without letting computer translate “macros” for me.

And here a solution. Instead of string %USERNAME% at %COMPUTERNAME% I need to put in GPO following string:

%<USERNAME>% at %<COMPUTERNAME>%

Now I get what I wanted to get in computer name “zilinec_admin at HPTS01” 🙂

 

Categories: Windows Tags: , , , , , , , , ,
  1. No comments yet.
  1. No trackbacks yet.