Forum Discussion
APM 11.4.0 registry check with session variable
Hi Guys, I try use session variable in registry check, but it doesn't work. Example: "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"."DefaultUserName" = session.logon.last.username
How can I use the session variable?
Thanks, MatBel
Unfortunately it's not possible to use session variables in the Registry Check. We encourage support tickets with enhancement requests though, please send one in. I was not able to locate an existing request for this feature, surprisingly.
EDIT: Starting with 12.1 this feature is added to get a value from the registry and store it as a session variable. There are restrictions because it has potential security implications. See the following for more information:
4 Replies
- Matt_Dierick
Employee
I would try :
"HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"."DefaultUserName" = %{session.logon.last.username}
- Lucas_Thompson_Historic F5 Account
Unfortunately it's not possible to use session variables in the Registry Check. We encourage support tickets with enhancement requests though, please send one in. I was not able to locate an existing request for this feature, surprisingly.
EDIT: Starting with 12.1 this feature is added to get a value from the registry and store it as a session variable. There are restrictions because it has potential security implications. See the following for more information:
- matbel_119218
Nimbostratus
Thanks for the answers. Is there another way to read the registry key: iRule, TCL?
- Alexander_Kova1Historic F5 Account
As a workaround you can try to use "Variable Assign" action on ".config" variable.
You can use:
configdump -allkeys | grep check_registryto find exact variable (registry check expression) to replace.
apm policy agent variable-assign ap1_act_variable_assign_ag { variables { { expression "return {%22HKEY_LOCAL_MACHINE64\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon%22.%22DefaultUserName%22 = %22%{session.logon.last.username}%22 }" varname config.windows_check_registry./Common/ap1_act_registry_check_ag.expression } } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
