Latest posts by Geoff Kendal (see all)
- How to add holidays to the Exchange calendar with PowerShell - Wed, Apr 23 2014
- How to change the domain name in Exchange Server 2010 - Tue, Apr 8 2014
- How to enable Unsolicited Remote Assistance in Windows 7 / 8 - Tue, Oct 1 2013
Back in Windows 95, the notification area, or system tray, was a bit of a free-for-all. Every application thought that it was worthy of a constant presence in the corner of your screen. While some of these icons are useful, the vast majority are generally not. Windows XP started to address this clutter issue by allowing us to hide/collapse the icons that we didn’t really use or need. Windows Vista removed more of these for us, with Windows 7 going a step further by making most icons here hidden by default, unless specifically permitted by the user to display in the notification area all of the time.
Notification Area alias System Tray
Most of the time, this management of our notification area is fine, however occasionally it can work against you. For example, you might roll out an instant messaging or business application that you would like to always be visible via the notification area. Windows will by default hide this from your users, and doesn’t provide an easy way to automate or script the visibility of these icons for system administrators, as the registry key that stores this information is a long binary key.
Luckily for us, Micah Rowland has spent a while reverse engineering this key, and produced a very handy script that easily allows us to force icons to be visible.
Go over to his site, and copy/paste the script into a new file, and save it as ‘NotifyIcons.ps1’. The next stage is to add the script into a GPO that runs for the users that you want to apply this setting to.
Open up the Group Policy Management MMC. Select your chosen Group Policy Object, right click and select Edit. In the editor, navigate to User Configuration > Windows Settings > Scripts > Logon
Group Policy Management Editor - Logon Scripts
Once you’re in the login script properties window, move to the PowerShell tab, and click the View Files button. This will open an Explorer window – Move the NotifyIcon.ps1 script we created earlier into this location, so that our GPO login script can see it, you can then close that Explorer window.
In the login script properties window, add a new PowerShell script, in the script name, enter NotifyIcon.ps1, and then in the parameters, enter the program name (case sensitive!) followed by the setting to use:
0 = only show notifications
1 = hide icon and notifications
2 = show icon and notifications
If you’re here and reading this far, you’ll probably want to select setting 2… In my example I enter ‘tftp32.exe 2’ as my parameters.
Add new PowerShell script
At this point, we can now save and close our GPO’s. Now when users login, the GPO should run our script that will look for tftpd32.exe in the notification area history, then set it to always display.
In order for this to work, the user must have previously run the application, and then properly logged out, so that explorer.exe gets a chance to write the updated notification area history to the Registry. On a subsequent login, our script should successfully locate the program in the history, and update its setting to always show.
If you run into difficulty, ensure that the case of the executable is correct – It does matter! You can also try running the script manually from a PowerShell prompt to debug, but you MUST kill explorer.exe (‘taskkill /f /im explorer.exe’) before running it, otherwise explorer won’t see your update, and will overwrite it when it does quit.