Controlling an RGS machine from your Mac

Sometimes you can get away with not using Bootcamp on your Mac. You might need a machine to render some video or other processing task, and you don’t require any hardware to be plugged in directly. In such cases, you can use a remote HP Z class workstation to do the heavy graphical lifting, and use your Mac as the window into the situation

HP offers a free set of software for remotely controlling their z workstations. There are two pieces of software necessary, a Sender, and a Receiver application. The Sender runs on the workstation and will work in both Windows and Linux operating systems. The Receiver application can run on your Mac, Windows, or Linux client system, and connects you to the workstation.

We at Sheridan have implemented an AppleScript for the Mac client to help users to connect to the Senders easily. This script will find an available machine for the user from the large pool of workstations, and log them into the RGS software. Once logged into the graphical session, the user can then login to the OS with their AD credentials.

I have included the code for the AppleScript below. Copy and paste it into Script Editor and modify the items in RED to your specifics. **Be aware that some formatting may need to be fixed such as quotes and dashes for comments.

 

<– cut and paste into Script Editor below this line–>

 

–mount the remote server that holds the folder of available machines

try

do shell script “mkdir /Users/Shared/Shepherd

end try

do shell script “mount -t smbfs -o nobrowse smb://username:password@Shepherd.local/RGS/ /Users/Shared/Shepherd/”

set sourceFolder to “Macintosh HD:Users:Shared:RGS:available”

delay 3

–get the name of an available workstation, sorted by oldest available, delete the file and unmount the server

try

tell application “Finder”

set theMachine to name of item 1 of (sort (get files of folder sourceFolder) by creation date)

set theMachine to text 1 thru -5 of theMachine

set theFile to item 1 of (sort (get files of folder sourceFolder) by creation date) as alias

set theFile to POSIX path of theFile

do shell script “rm ” & theFile

do shell script “umount /Users/Shared/Shepherd

do shell script “rm -R /Users/Shared/Shepherd

end tell

on error

display dialog “There are no remote machines available at the moment. Please nofity someone via email at  support@mycollege.com so they can investigate.” buttons {“OK”} default button {“OK”} with icon stop

do shell script “umount /Users/Shared/Shepherd

do shell script “rm -R /Users/Shared/Shepherd

return

end try

–launch the RGS application and pass the url and authentication data to the remote Sender connection

tell application “HP RGS Receiver.app” to activate

delay 1

tell application “System Events”

tell process “HP RGS Receiver”

set value of text field 1 of pop up button 1 of window 1 to theMachine

click button “Connect” of window 1

delay 2

set value of text field 1 of window 1 tousername

set value of text field 2 of window 1 topassword

click button “OK” of window 1

delay 3

–set the remote window to full screen and move the window to the top left corner

tell front window

tell (first button whose subrole is “AXFullScreenButton”)

perform action “AXZoomWindow”

end tell

end tell

end tell

set position of first window of application process “HP RGS Receiver” to {0, 0}

end tell

–display dialog asking the user to logout on completion

tell application “System Events”

display dialog “Please logout of the remote machine when you are finished using it.” buttons {“OK”} default button {“OK”} with icon caution giving up after 10

end tell