Hello,
I'm using LyncSetup 1.2 (http://www.officeformachelp.com/lync/administration/setup-script/) to deploy Microsoft Lync, and at the end of the policy, I'd like to have the application open as the user. I'm using this script (modified for Lync):
#!/bin/bash
declare
-x UserName="$(/usr/bin/who | /usr/bin/awk '/console/{print $1;exit}')"
echo
"Derived Console username: $UserName"
declare
-x LoginWindowPID="$(/bin/ps -axww | /usr/bin/grep loginwindo[w] | /usr/bin/awk '/console/{print $1;exit}')"
echo
"Found PID: $LoginWindowPID"
/bin/launchctl
bsexec "${LoginWindowPID:?}" /usr/bin/sudo -u "$UserName" /usr/bin/open /Applications/Calculator.app
From https://jamfnation.jamfsoftware.com/discussion.html?id=4117
But I'm getting a Microsoft error message when the script runs in the policy. Does anyone have a suggestion for how I might successfully launch Microsoft Lync, as the user, at the end of the Lync deployment policy? Thanks.
