MacOSX reset VNC and LMI

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart –agent
then
sudo ps auxwww | grep loginwindow | grep -v grep | awk ‘{print $2}’ | xargs sudo kill -9