Apple Remote Desktop Client has been displaying “Current Status = Offline” for machines without cause. When a mac is “Offline”, ARD, AFP, SMB, and SSH are stop working. However, the
mac can still be pinged and its web server is still accessible.
Apple Remote Desktop Client is crashing and causing the issues. I don’t understand why SSH and SMB stop working when this happens, any comments would be appreciated.
I’m posting the AppleScript that I wrote to resolve the issue. A restart is not required, but resolved network issues outside of ARD for me. Please comment if this works, doesn’t work or needs to be updated in any way.
on doShellScript(cmd, pswd)
if (length of pswd > 0) then
display dialog pswd
do shell script cmd password pswd with administrator privileges
else
display dialog "This process requires an admin password."
requestInput()
end if
end doShellScript
on restartNow()
tell application "Finder"
restart
end tell
end restartNow
on requestInput()
set admin_password to display dialog ¬
"Please enter your password:" with title ¬
"Password" with icon caution ¬
default answer ¬
"" buttons {"Cancel", "OK"} default button 2 ¬
giving up after 295 ¬
with hidden answer
set pswd to text of text returned of admin_password
set cmds to {¬
"ls", ¬
"sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -agent -stop", ¬
"sudo rm -R /Library/Application\\ Support/Apple/Remote\\ Desktop/Client", ¬
"sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -agent -restart"}
doShellScript(item 1 of cmds, pswd)
doShellScript(item 2 of cmds, pswd)
doShellScript(item 3 of cmds, pswd)
requestRestart()
end requestInput
on requestRestart()
set restartAnswer to display dialog ¬
"Would you like to restart now?" with title ¬
"Restart" with icon caution ¬
buttons {"Cancel", "OK"} default button 2 ¬
giving up after 295
set answer to text of button returned of restartAnswer
if (answer is equal to "OK") then
restartNow()
end if
end requestRestart
requestInput()