I want to deploy a apple script to macs via kaseya how can I deploy and run an apple script?
set HostName to do shell script "sudo scutil --get ComputerName" user name "Administrator" password "password" with administrator privileges
set LocalHostName to do shell script "sudo scutil --get ComputerName" user name "Administrator" password "password" with administrator privileges
I can export it as a .app, script script bundle or text. Any ideas
Utilize the ExecuteCommandShell() as System to execute the scutil --get ComputerName
I ran this on my mac and sudo is not required.
I have been able to output the value to a file and consume the text file to place this in a variable in AP n post to AP Log.
How can I make it automated for all macs. I want to get the computer name and change the HostName and LocalHostname to that.
Make sure its System in 64 bit.
the --set command works as well.
see attached procedure
I see in the remote management that the wrong dns name is still there. Is a reboot for flush of dns required for this to take effect?
if you run the procedure and call HostName you see the change.
What remote management are you referring to?
If you open system preferences and go to sharing and under remote management I still see the old name.