shell - To create a apple script to change the name of the computer with out prompting for admin -


i attempting create script grab serial number of mac , set hostname, localhostname, & computername out prompting administrator credentials. far have , trying work through it.

how put credentials in script pulls info without prompting?

set sys shell script "/usr/sbin/system_profiler sphardwaredatatype " without altering line endings  set stringvariable1 "serial"  set serial_number shell script "/usr/sbin/system_profiler sphardwaredatatype | awk '/serial/ { print $nf }' "   shell script "scutil --set hostname " & serial_number administrator privileges shell script "scutil --set localhostname " & serial_number administrator privileges shell script "scutil --set computername " & serial_number administrator privileges  display dialog "the mac has been renamed " & serial_number 


Comments