If you thought the Login Hook code was cool, wait until you check out these examples provided by SVS Guru Dale Bethers.
Hopefully these examples will help those who are having problems configuring the SVS User Logon Hook. First we will look at the "Filename" and "Url" registry values and then the "LoggingFlags" registry value.
"Filename" and "Url" Registry Values
The "Filename" and "Url" registry values tell the SVS User Logon Hook were it should look to find the configuration file. The "Url" value takes precedent over the "Filename" value, meaning that if there is a "Url" value, the SVS User Logon Hook will always look there first for a configuration file. These registry values do not affect SVSUserAdmin. SVSUserAdmin is basically a specialized XML file editor. It will open any file it is told to open no matter where it is. Also it will look for the files in its "Recent Files" list in same place they were the last time they were edited, regardless of where the "Filename" and "Url" values are pointing. The registry key the values should be created on is "HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Virtualization\Winlogon\VzUserSwXml" as shown in the following screenshot. You will need to create the parent key "VzUserSwXml" first; it is not created by default.
If the keys and their values are not created in the correct place with the correct spelling, you will see the following error in the error log (which we will talk about in just a minute.):
Error parsing XML file VzUserSwXml.xml on line 0: The system cannot locate the resource specified.
If the SVS User Logon Hook doesn't find the appropriate registry key and value, it will by default look for a file called "VzUserSwXml.xml" in the "%WINDIR%\system32" directory, if it doesn't find the default file either it will log the message above.
In this version of the SVS User Hook, the "Url" value must point to an HTTP server; UNC paths are not supported. The configuration file can exist anywhere on the HTTP server that is addressable by a Url. Also it is not necessary to have both a "Filename" and "Url" value if both are not being used.
"LoggingFlags" Registry Value
The SVS User Logon Hook can be configured to log messages to the system event log; which can be viewed by right clicking on "My Computer" and selecting "Manage" and then selecting "Application" under the "Event Viewer".
Other application may also be logging events; the events logged by the SVS User Logon Hook will have "VzUserSw" set as the source.
The SVS User Logon Hook divides events it can report into four groups:
|Event Type||Hex Value||Binary Value|
Any combination of event types can be requested by setting the bits for the event types you want. For example to request Errors and Warnings you would get hex 6 (binary 0110). If you want to avoid bit twiddling or hexadecimal math you can just set the registry key value to hex F (binary 1111); which will give you all events types.
The "LoggingFlags" value is created on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Virtualization\Winlogon\VzUserSw" as shown in the following screen capture.
I hope this has helps answer some questions.