In Ecstasy's Name Mac OS

The Challenge: As part of our deployment process for Macs in an AD environment, technicians are expected to rename the computer using a combination of Preferences panes as well as command line. The steps involved are considerably more tedious than joining AD on a Windows machine.

The Solution: An AppleScript application that accomplishes all of the following:

  • Set Computer Name (normally done in Sharing prefs)
  • Set Local Host Name (normally done in Sharing prefs)
  • Set NetBIOS name (normally done in Network prefs)
  • Verify FQHN
  • Set system HostName (normally done via Terminal with scutil)
  • Bind to AD (normally done through Directory Utility)

Below is the script! OR, click here for pastebin!

The Script (save this as an Application in OS X, then you can double click it to start):

  1. The history of macOS, Apple's current Mac operating system originally named Mac OS X until 2012 and then OS X until 2016, began with the company's project to replace its 'classic' Mac OS.That system, up to and including its final release Mac OS 9, was a direct descendant of the operating system Apple had used in its Macintosh computers since their introduction in 1984.
  2. There's an app (in the Mac App Store) that lets you name Spaces via the menubar. It also lets you give each Space a unique icon, and tells you how you spend time across your Spaces (and the apps within them). Because macOS APIs are limited, the names stay in the app and don't show up in Mission Control. But they are persistent.
Name

–get a domain admin user name and password which will be used to bind

setuser_name_dialogtodisplay dialog “Enter a domain admin account name: ” default answer “” buttons {“Next”} default button “Next”

In Ecstasy's Name Mac Os X

Etresoft, I don't think it will take only 28 years to reach Mac OS 30. There's no way to tell the amount of years for sure, but if they keep the pattern of getting to.9 then going up 1 that's 193 to go. (including 10.7 Lion).

setuser_nametotext returnedofuser_name_dialog

setuser_password_dialogtodisplay dialog “Enter the domain admin password. ” & return & return & “WARNING: If you are running Panther (MacOS 10.3), your input will be displayed in this box as clear text.” default answer “” buttons {“Next”} default button “Next” withhidden answer

setuser_passwordtotext returnedofuser_password_dialog

–Set the computer name is proper before we bind

setcomputerNametotext returnedof (display dialog “Set the computer name (ex: JDoe12345m)” default answer “”)

–Set the computer name and local hostname on the computer incase it was just renamed in the previous step

do shell script “scutil –set ComputerName” & space & computerNamewithadministrator privileges

do shell script “scutil –set LocalHostName” & space & computerNamewithadministrator privileges

–We also want to verify the FQHN is proper before we bind

setcomputerFQHNtocomputerName & “.hq.hview.com”

–Set the computer name on the computer incase it was just renamed in the previous step

do shell script “scutil –set HostName” & space & computerFQHNwithadministrator privileges

–Start binding

— Change AD.DOMAIN.COM to your AD domain

— Also change DC=ad,DC=domain,DC=com

do shell script “dsconfigad -f -a ” & computerName & space & “-domain HQ.Hview.com -u ” & user_name & ” -p ” & user_password & ” -ou ”CN=Computers,DC=HQ,DC=Hview,DC=com”” withadministrator privileges

–Replace values below with items specific to your domain

do shell script “dsconfigad -alldomains enable -localhome enable -protocol smb -mobile enable -mobileconfirm disable -useuncpath enable” withadministrator privileges

In Ecstasy's Name Mac Os Download

do shell script “defaults write /Library/Preferences/DirectoryService/DirectoryService ‘Active Directory’ Active” withadministrator privileges

In Ecstasy's Name Mac Os 11

do shell script “plutil -convert xml1 /Library/Preferences/DirectoryService/DirectoryService.plist” withadministrator privileges

delay 10

–Kickstart DirectoryService

tellapplication “Terminal” toactivate

In Ecstasy's Name Mac Os Catalina

tellapplication “Terminal” toquit

do shell script “dscl /Search -create / SearchPolicy CSPSearchPath” withadministrator privileges

delay 5

tellapplication “Directory Utility” toactivate

display dialog (do shell script “dsconfigad -show” withadministrator privileges)