Adding a hostname to a regkey

(imported topic written by reuas_gis91)

Greetings,

I have a problem adding the computername as a registry entry. I am using RSA SecurID for authentication and with their new version I am trying to make a change in the machine’s registry. Here is my current fixlet:

appendfile {“Windows Registry Editor Version 5.00”}

appendfile {"

HKEY_LOCAL_MACHINE\SOFTWARE\RSA Security\RSA Authentication Agent\CurrentVersion\Settings\SDGINA

"}

appendfile “RSALegalNoticeText”=""

appendfile “PinAttempts”=dword:00000003

appendfile “PinLifetime”=dword:0000004b

appendfile “EnablePinUnlock”=dword:00000000

appendfile “RSALegalNoticeCaption”=""

appendfile “EnableNovellPasswordUpdate”=“0”

appendfile “InstallPath”=“C:\Program Files\RSA Security\RSA Authentication Agent\”@=""

appendfile “MajorVersion”=dword:00000006

appendfile “MinorVersion”=dword:00000001

appendfile "“CustomBitmap”=“C:\Program Files\RSA Security\RSA Authentication Agent\gina_banner.bmp”

appendfile “SecurIDAuthMechType”=dword:00000001

appendfile

“ChallengeGroup”="\\(hostname)\2QD"

appendfile “Enabled”=dword:00000001

appendfile “PrimaryDomain”=“GreenB”

appendfile “DomainCache”=JCMarshall’s.org "

appendfile ““TraceFile”=”“C:\Windows\AceClient.log”"

The edit is in bold. I need to resolve the machine’s host name. I ran this key as is and the end result was (hostname\2QD) in the registry.

I have tried to use Regset "

HKEY_LOCAL_MACHINE\SOFTWARE\RSA Security\RSA Authentication Agent\CurrentVersion\Settings\SDGINA

" “ChallengeGroup”= {\2QD}

My syntax is wrong and I cannot figure out how to enter the machine’s host name. I know when I use the fixlet debugger and type in Hostname is give me the output I need. Q&A tells me “name is not defined” when I tried Name of it as lowercase of it =“computername” (somewhere a long those lines. I was not able to save that last query because q&a quit on me).

Any help is greatly appreciated.

PS. I was thinking of using \%computername%\2QD on the appendfile but I cannot remember if windows will be able to figure it out.

Thanks again.

S.

(imported comment written by SystemAdmin)

In Q&A it’s just: computer name

or hostname

In an action, put whatever you want evaluated within {}

You can use either one of these…

appendfile “ChallengeGroup”="\{computer name}\2QD"

appendfile “ChallengeGroup”="\{hostname}\2QD"

(imported comment written by reuas_gis91)

Using the Action Report I get the desired result but the changes are not being made:

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\RSA Security\RSA Authentication Agent\CurrentVersion\Settings\SDGINA

" “ChallengeGroup”={hostname}\2QD

It returns with

path

\Computer123\2QD. So the Action Debugger works. I wonder why it does not set it on the client.

Edit:

I am making a separate task, that only does the regset portion. Hope that works.

(imported comment written by BenKus)

Looks like a syntax issue… make sure you escape the results properly and you include the quotes:

regset “HKEY_LOCAL_MACHINE\SOFTWARE\RSA Security\RSA Authentication Agent\CurrentVersion\Settings\SDGINA” “ChallengeGroup”="\{hostname}\2QD"

Ben

(imported comment written by reuas_gis91)

Testing it out now. Thanks Ben and Paul. If this works I owe you guys some beer.

Ben, it works great. Thank you very much Paul and Ben.