Renaming Machines and disable Computername-Field

holger
New Contributor

Hi Folks,

how would you scriptbased rename machines and disable the Machinename-Box in the Sharinge-Pane?

Cheers,
Holger

----
Holger Bartels
Max-Planck-Institut for Biophysical Chemistry
IT & Elektronik Service
Am Faßberg 11
D-37077 Goettingen, Germany
phone: +49 (0)551 201-1398
e-mail: holger.bartels[at]mpibpc.mpg.de

5 REPLIES 5

Not applicable

When you set the computer name in System Preferences -> Sharing, there are two things that get changed
in the OS: the Computer Name and Local Host Name. The Local Host Name is the same as the Computer Name
only it uses dashes instead of spaces.

Here's a command you can run to change the name of the machine. Change the words Enter Name Here, between
the quotes, to desired name:

name="Enter Name Here"
scutil --set ComputerName "$name"
scutil --set LocalHostName `echo "$name" | sed 's/ /-/g'`

Thank You,
Nick King | Analyst II | Macy*s System & Technology
Apple Certified Support Professional ?

151 West 34th Street, 17th Floor | New York, NY 10001
(: 212.494.1884 (Service Desk)
(: 212.494.2253 (Direct Line)
*: nick.king at macys.com

Not applicable

Also, what to you mean when you say "disable the machine name box"?

Thank You,
Nick King | Analyst II | Macy*s System & Technology
Apple Certified Support Professional ?

151 West 34th Street, 17th Floor | New York, NY 10001
(: 212.494.1884 (Service Desk)
(: 212.494.2253 (Direct Line)
*: nick.king at macys.com

nessts
Valued Contributor II

there is a MCX setting under login, Set computer name to computer record name

--
Todd Ness
Technology Consultant/Non-Windows Services
Americas Regional Delivery Engineering
HP Enterprise Services

Cem
Valued Contributor

Hi Holger,

I am using MCX (Managed Preferences) to grey out Sharing Prefs
Pane'Computer Name section.
com.apple.loginwindow
System Level Enforced

UseComputerNameForComputerRecordName boolean FALSE

I have posted this script couple of weeks ago (see below 2 emails - second
one adds the cancel button). It lets you change the names using Self
Service. But you can tweak it to use it silently too. Its for AD
environment but you don't need to use that part of the script.

Date: Thu, 27 Oct 2011 12:20:35 +0000

holger
New Contributor

Hi,

thanks, this is awesome!

Cheers,
Holger