Deny change of Computer Name by Users

maiksanftenberg
Contributor II

I'm looking for an option to deny users (admins) from changing there Computer Names. It's not possible for our Standard Users but for the Admin Users.

Is there any trick that you can re-command to do this?

We could disable the complete Sharing options via the authorization file or in 10.9 the authorization db?

Thanks,
Maik

5 REPLIES 5

bentoms
Release Candidate Programs Tester

@maik.sanftenberg, you could block the Sharing Pane via MCX.

nessts
Valued Contributor II

if you do a configuration profile for loginwindow under the options tab there is an option to set computername to computer record name. this will grey out the box in the sharing tab disallowing users to change it.
of course if they have sudo and know about scutil all bets are off.

Matt
Valued Contributor

I had a script posted here that stored the computer name and then restored it on Login. Ill try and find it but I was having issues with the provided JAMF mechanism actually working all the time. This worked all the time, it was an extension attribute.

cbrewer
Valued Contributor II

Are your Macs bound to AD? The AD binding name is a bit more difficult to change. I have a script that periodically checks the AD binding name and if the sharing name doesn't match, it'll reset the sharing name to match the AD name.

JonathanChan
New Contributor

Like cbrewer, I wrote a quick script to update the computer name to match the binding name. I have this setup as a policy. https://github.com/jonathanchan/Macs-AD/blob/master/hostname_check.py. It should be trivial to update this if you don't use AD.