Kaseya Community

Always Show Agent Icon in Windows 7 System Tray

This question has suggested answer(s)

Does anyone have an automated method of preventing the Kaseya agent icon from being hidden in the Windows 7 system tray?  I want to accomplish the same thing as clicking customize on the system tray then choosing "Show icons and notifications".

Thank in advance.

All Replies
  • I had a procedure that made all system tray icons permanently show but this can look messy if there are loads.  I think the registry keys just below this hive are where it's set but it's a bit messy in there.

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer

    "EnableAutoTray"=dword:00000000

    Set to 1 to hide all inactive

  • Try editing the following key and adding -remote to the end of it

    i.e.

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run ... if 64Bit or

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run for 32Bit

    Add -remote as below

    "C:\Program Files (x86)\Kaseya\MCLCM297676359459738\KaUsrTsk.exe" -remote

  • Paul,  it's my understanding that adding -remote will show make the icon shown in RDP sessions, where there normally is no system tray icon.

    What I am interested in is an automated way to make it not hidden on local sessions.

  • Procedure PiM Rename Agent Config Service.xml

    @ eperson,

     

    I have made the following script to change the settings of the agent. (Automatic) Maybe it works for you aswell as for me... (i used a existing script and changed it and added some)

    Change the following to your own config.

    In script:                                                Example:

    ENTERKALICENSECODE                 KA376234983585
    ENTERDISPLAYNAME                       Kagent
    ENTERINSTALLDIRECTORY           Kagent
    ENTERLICENSECODE                     376234983585
    ENTERDESCRIPTION                      Please do not stop this service.
    ENTERPUBLISHERNAME               companyname
    ENTERTITLE                                       companyname

     

    <?xml version="1.0" encoding="utf-8"?>
    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">
      <Procedure name="Rename Agent Config Service" treePres="3" id="1824695806" folderId="65932132921152462534156134">
        <Body description="This will modify the agent Icon and other variables as needed depending on OS Version">
          <Statement description="" name="GetVariable" continueOnFail="false">
            <Parameter xsi:type="EnumParameter" name="VariableType" value="AgentInstallDirectory" />
            <Parameter xsi:type="StringParameter" name="SourceContent" value="" />
            <Parameter xsi:type="StringParameter" name="VariableName" value="agentInstall" />
          </Statement>
          <If description="This will check to see if the SERVER OS is 64 BIT, then run the deployment scripts as needed">
            <Condition name="TestFile">
              <Parameter xsi:type="StringParameter" name="Path" value="C:\Windows\SysWOW64 " />
              <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />
              <Parameter xsi:type="StringParameter" name="Value" value="" />
            </Condition>
            <Then>
              <Statement description="" name="PauseScript" continueOnFail="false">
                <Parameter xsi:type="IntegerParameter" name="Seconds" value="150" />
              </Statement>
              <Statement description="Sets the Add Remove Name for Uninstall" name="SetRegistryValue64" continueOnFail="false" osType="Windows">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ENTERKAENTERLICENSECODE\DisplayName" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERDISPLAYNAME" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Agent icon in taskbar" name="SetRegistryValue64" continueOnFail="false" osType="Windows">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run\ENTERKAENTERLICENSECODE" />
                <Parameter xsi:type="StringParameter" name="Value" value="&quot;C:\INSTALLDIRECTORY\Agent\ENTERLICENSECODE\KaUsrTsk.exe&quot; -remote" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Sets the displayname for services" name="SetRegistryValue64" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ENTERKAENTERLICENSECODE\DisplayName" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERDISPLAYNAME" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Sets the Description for services" name="SetRegistryValue64" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ENTERKAENTERLICENSECODE\Description" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERDESCRIPTION." />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Sets the action for services when failed" name="SetRegistryValue64" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ENTERKAENTERLICENSECODE\FailureActions" />
                <Parameter xsi:type="StringParameter" name="Value" value="80 51 01 00 00 00 00 00 00 00 00 00 03 00 00 00 43 00 50 00 01 00 00 00 C0 27 09 00 01 00 00 00 C0 27 09 00 01 00 00 00 C0 27 09 00" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="Binary" />
              </Statement>
              <Statement description="Sets the Publisher name" name="SetRegistryValue64" continueOnFail="false" osType="Windows">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ENTERKAENTERLICENSECODE\Publisher" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERPUBLISHERNAME" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Sets the Publisher name" name="SetRegistryValue64" continueOnFail="false" osType="Windows">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Kaseya\Agent\ENTERENTERLICENSECODE\Publisher" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERPUBLISHERNAME" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Sets the Publisher name" name="SetRegistryValue64" continueOnFail="false" osType="Windows">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Kaseya\Agent\ENTERLICENSECODE\Title" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERTITLE" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
            </Then>
            <Else>
              <Statement description="Sets the Add Remove Name for Uninstall" name="SetRegistryValue" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ENTERKALICENSECODE\DisplayName" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERDISPLAYNAME" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="This step sets the Service name" name="SetRegistryValue" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ENTERKALICENSECODE\Description" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERDESCRIPTION" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="" name="SetRegistryValue" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ENTERKALICENSECODE\DisplayName" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERDISPLAYNAME" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Agent icon in taskbar" name="SetRegistryValue" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\ENTERKALICENSECODE" />
                <Parameter xsi:type="StringParameter" name="Value" value="&quot;C:\ENTERINSTALLDIRECTORY\Agent\ENTERLICENSECODE\KaUsrTsk.exe&quot; -remote" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
              <Statement description="Sets the action for services when failed" name="SetRegistryValue" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ENTERKALICENSECODE\FailureActions" />
                <Parameter xsi:type="StringParameter" name="Value" value="80 51 01 00 00 00 00 00 00 00 00 00 03 00 00 00 43 00 50 00 01 00 00 00 C0 27 09 00 01 00 00 00 C0 27 09 00 01 00 00 00 C0 27 09 00" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="Binary" />
              </Statement>
              <Statement description="Sets the Publisher name" name="SetRegistryValue" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ENTERKALICENSECODE\Publisher" />
                <Parameter xsi:type="StringParameter" name="Value" value="ENTERPUBLISHERNAME" />
                <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
              </Statement>
            </Else>
          </If>
          <If description="Checks for OS">
            <Condition name="TestFile">
              <Parameter xsi:type="StringParameter" name="Path" value="&quot;C:\ProgramData\Start Menu\NUL&quot;" />
              <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />
              <Parameter xsi:type="StringParameter" name="Value" value="" />
            </Condition>
            <Then>
              <Statement description="Remove the RealVNC Directory from the start menu" name="ExecuteShellCommand" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Command" value="rmdir /S /Q &quot;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\RealVNC&quot;" />
                <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
              </Statement>
              <Statement description="" name="ExecuteShellCommand" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Command" value="rmdir /S /Q &quot;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Kaseya&quot;" />
                <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
              </Statement>
            </Then>
            <Else>
              <Statement description="Takes care XP" name="ExecuteShellCommand" continueOnFail="false" osType="Windows">
                <Parameter xsi:type="StringParameter" name="Command" value="rmdir /S /Q &quot;C:\Documents and Settings\All Users\Start Menu\Programs\RealVNC&quot;" />
                <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
              </Statement>
              <Statement description="Delete Kaseya start menu entry" name="ExecuteShellCommand" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Command" value="rmdir /S /Q &quot;C:\Documents and Settings\All Users\Start Menu\Programs\Kaseya&quot;" />
                <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
              </Statement>
            </Else>
          </If>
        </Body>
      </Procedure>
    </ScriptExport>

     

     

  • sorry for the 3 posts, they are the same. My explorer failed on me. haha

  • @Wesley - I took care of the dupes.

  • Wesley, so with that script, the Kaseya icon in the system tray will never be hidden?

    Thanks.

  • It appears from this post on Technet, it's not easy to do what I am looking for.  Here's a quick summary:

    social.technet.microsoft.com/.../677c0753-92ef-46ba-b239-437c3c6a38aa

    "There is no way for applications to programmatically always show themselves top level on the system tray either on first install or at any time during runtime. This is one of several changes we’ve made in Windows 7 in an effort to produce a cleaner, quieter desktop that is in the user’s control to customize the top level with their favorite applications and icons.

    We keep the user in control of the notification area by not allowing programmatic promotion (other than temporarily or to show a notification). Assuming the machine is sufficiently quiet, when you first add your icon with Shell_NotifyIcon(NIM_ADD, ...) it will be shown on the taskbar for 45 seconds, then move into the overflow

    thereafter. If the user promotes an icon, it will always live on the taskbar. If the user demotes it, the icon will never be seen on the taskbar. Any promotion needs to be user initiated. We’ve made this much easier in Windows 7 via drag/drop & through the Notification Area Icons control panel, and what we’ve seen in usability studies and based on beta feedback, is that users have no difficulties discovering how to customize notification behavior and will promote the icons they want quick access to."

  • @ Eperson,

    Of course I can't say never. But with the -remote in the registry the services will start with that credential. I must say that this doesn't work on a Terminal Server. The first user (0) will have the Icon. All others won't.

  • Wesley,

    I think I was a little unclear regarding what I was trying to accomplish.  I was looking for a method to force the icon to always never be hidden, so the user doesn't need to click the arrow to show the hidden icons in the system tray.  To manually accomplish this in Windows 7, you would click the arrow, choose "Customize...", find the Kaseya icon in the list and change from "Only show notifications" to Show icon and notifications".  From that post on Technet, it does not look like this is possible.

  • I ran a Kpackager and changed the icon notify settings and here are the Reg Key changes:

     

    Replace Registry Value: %USERKEY%\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify\IconStreams
    Replace Registry Value: %USERKEY%\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify\PastIconsStream

    Replace Registry Value: %USERKEY%_Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify\IconStreams
    Replace Registry Value: %USERKEY%_Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify\PastIconsStream

     

    If you look at these their fairly complex on trying to figure out what goes where. I'd say you're best bet is to go with the on / off for all of them as previously posted in this thread.

  • I know this is old, but I hope it helps. It is indeed possible, with PowerShell and GPO

    4sysops.com/.../forcing-notification-area-icons-to-always-show-in-windows-7-or-windows-8

  • Hi,

    The solution is not very easy unless you want to show all icons...below is a link to a discussion where a contributor has a powershell script that prompts for the application name and then modifies the IconStreams value under HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify.  Since this registry setting is user specific you would need to detect if a user was logged in and then run a modified version of the powershell script (that does not prompt for the application name) on the machine in the context of the logged on user.  This could then all be delivered in an agent procedure and would need to run periodically on all machines so that it has high probability or running when a user is logged on.

    See this posting for more information...

    superuser.com/.../make-tray-icon-always-show-for-all-profiles-in-windows-7

    Regards,

    Matt Warburton

    Kaseya Professional Services

  • I was looking for a solution to this also. if you do not have a problem pushing an exe down to the client to resolve then read on.

    Brute force seemed to be the only way:

     

    In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer create a new DWORD value named EnableAutoTray and set it to 0 to turn off the Notification Area's 'auto hide' features.

     

    This turns off auto hide for all icons on the systray. How stupid.even found other people on Kaseya forums struggling for a solution.

     

    From Microsoft:

    There is no way for applications to programmatically always show themselves top level on the system tray either on first install or at any time during runtime. This is one of several changes we’ve made in Windows 7 in an effort to produce a cleaner, quieter desktop that is in the user’s control to customize the top level with their favorite applications and icons.

    We keep the user in control of the notification area by not allowing programmatic promotion (other than temporarily or to show a notification). Assuming the machine is sufficiently quiet, when you first add your icon with Shell_NotifyIcon(NIM_ADD, ...) it will be shown on the taskbar for 45 seconds, then move into the overflow thereafter. If the user promotes an icon, it will always live on the taskbar. If the user demotes it, the icon will never be seen on the taskbar. Any promotion needs to be user initiated. We’ve made this much easier in Windows 7 via drag/drop & through the Notification Area Icons control panel, and what we’ve seen in usability studies and based on beta feedback, is that users have no difficulties discovering how to customize notification behavior and will promote the icons they want quick access to.

    So I knew there had to be a better way, if this little piece of annoyingness from Microsoft pissed me off then someone else fixed it. First a Vbscript, then I found someone had assembled it in C#. traymanager.exe works, I tested it, scanned it, its good. problem solved.

     

    The command line for Kaseya is:

     

    TrayManager.exe -p KaUsrTsk.exe 2

     

     

    command line options:

     

    TrayManager.exe -t “Program ToolTip” 2

    TrayManager.exe -p “Program name” 2

     

    0=hide when inactive

    1=always hide

    2=always show

     

    I will attach the application with 2 different dlls. If you want to use the Program in windows 8 you have to rename TrayNotificationManagementWin8.dll to TrayNotificationManagement.dll and put the dll into the same folder as TrayManager.exe. Otherwise it will fail. The Datagrid list will automatically update itself if there is a notification change ongoing in the Notification area of Windows, like update, deleting or modifying something there.

     

     http://hianz.wordpress.com/2013/09/03/new-windows-tray-notification-manager-is-here/

  • Thank you for sharing that.