Using the context awareness features of RES One Workspace, I wanted to be able to Hide an application and display a message to the user in RES One Workspace when they are not logged on from a authorised device.
In RES One Workspace, if you implement a Zone to control application access, the user does not see the application in their Start Menu. This can be quite confusing for users and potentially generate support calls so I came up with the following work around to display a message to the user when they try to run the application from an unauthorised device.
I do this by creating 2 icons for the application. One of them is for the real application and is visible when they are using an authorised device the other uses the same application icon and name but runs a PowerShell script and this one is only visible when they are using a unauthorised device.
First, copy and paste the PowerShell code below into notepad and save as .ps1. This needs to be baked into your gold image or deployed to all the devices running the RES One Workspace agent. I took this code from here and modified it slightly to user system variables for the dialog box title bar and message content.
$wshell = New-Object -ComObject Wscript.Shell
$wshell.Popup($env:PopupMessage,0,$enn:PopupTitle,0x1)
Create a Zone that contains the devices you want to allow to use the application.
Create the application in RES Workspace console. Set the Access Control so that the application is only visible for the Zone containing the devices.
Create a duplicate of the application and change the paths to point to the PowerShell script. Make sure the application icon remains the same.
The command line is
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
The parameters are
-executionPolicy bypass -windowstyle hidden -file C:\Scripts\Error.ps1
Set the Access Control so that the application is only visible when the Zone is NOT applicable. We want users to see the dummy app when they are outside of the Zone.
Set the Startup style to be Minimized. Even though we are executing the script window as hidden it still appears for some reason so this is required.
Using RES One Workspace create the two system variables at logon that correspond to the variables in the PowerShell script.
Now when users are outside of the Zone and they try to launch Visio they will get the error below.
The beauty of this solution is you can change the error to whatever you like by either changing the variables which are set at logon or creating specific variable that are set at the application launch time as below.
Now when users launch the dummy Visio application they get a more specific error message.
I think it would be nice if RES could build this sort of functionality into Workspace so that custom messages can be displayed when a user it outside of a Zone and tries to run an application.