erattorney.blogg.se

Macos rename
Macos rename






macos rename

# Dialog to confirm that the hostname was changed and what it was changed to.

macos rename

adminGroups "domain admins,enterprise admins,domaingroup" # Set Hostname using variable created above $CD progressbar -indeterminate -title "Renaming Computer" -width 250 -height 80 /tmp/hpipeĭsconfigad -force -remove -username *replace* -password *replace* # Dialog to show a please wait box while we work. Rv=($($CD standard-inputbox -title "Computer Name" -no-newline -informative-text "Enter the new name of the computer.")) # Dialog to enter the computer name and the create $COMPUTERNAME variable Taken me long enough but finally found what I wrote to do all this! #!/bin/bashĬD="/private/tmp/CocoaDialog.app/Contents/MacOS/CocoaDialog" usr/local/jamf/bin/jamf policy -event rebind

macos rename

#Rebind to Active Directory assuming you have a directory binding in your JSS usr/sbin/dsconfigad -force -remove -u noaccountneeded -p nopasswordneeded #Run an inventory update to reflect name change in the JSS. usr/sbin/scutil -set LocalHostName "$result" usr/sbin/scutil -set ComputerName "$result" #Change computer name, local hostname, and hostname with user provided input. Result=$(echo $ComputerName | sed -e 's/1 //g') Enter in Computer Name to Rename WithĬomputerName=$(/Applications/Utilities/CocoaDialog.app/Contents/MacOS/CocoaDialog inputbox -title "Rename Computer" -informative-text "Enter Computer Name" -button1 "Rename" -button2 "Cancel") You do need Cocoa Dialog installed in the path below. This script is used to change the computer name, hostname, computer name is the JSS, and in Active Directory. To change it in AD and MAC OS the following script will work. The process above by will just rename in on the MAC OS level.








Macos rename