10-23-2015 09:09 AM - last edited 12-20-2015 11:12 PM
How do I rename a Mac OS X computer that is joined using Centrify Express Agent for Mac? Must I unjoin, rename and then join again? If I do that, will I need to go into AD and delete the old computer object?
Solved! Go to Solution.
10-23-2015 09:22 AM
Provided that you have the proper rights in Active Directory, you can do this all from the OS X system straight from the CLI.
It looks like this:
(domain name: corp.contoso.com; AD user that can join/remove = dwirth)
# First, leave the domain $ sudo adleave --remove --user dwirth --verbose ## Here you would rename your mac to the desired name. # Second, rejoin with the new name $ sudo adjoin --workstation --user dwirth --verbose corp.contoso.com
Make sure you know a local admin user just in case the rename requires you to reboot (behavior changes between OS X versions)
10-23-2015 11:01 AM
To expand a bit on Robertson's answer above:
OS X uses a couple of different hostname properties and they're all used in slightly different places so it's recommended to keep them all in line.
The full command sequence would look like this:
(1) Log into the Mac as Local Admin and run:
sudo adleave --remove --user dwirth --verbose sudo scutil --set HostName MAC-HOSTNAME sudo scutil --set LocalHostName MAC-HOSTNAME sudo scutil --set ComputerName MAC-HOSTNAME
(2) If possible, go to the DNS server and delete the DNS record of the Mac
(3) Go back to the Mac and run:
sudo adjoin --workstation --user dwirth --verbose corp.contoso.com
- "dwirth" is the username of the AD user authorised to leave / join machines from the domain
- "MAC-HOSTNAME" is the new hostname of the Mac
- "corp.contoso.com" is your actual domain name.
This sequence should avoid any potential future issues related to hostname mismatches.
01-17-2016 01:02 PM
Thanks, Brian and Robertson.
The solution you propose will indeed result in a machine that has a different name than before and is joined to Active Directory with the new name. However, the Active Directory object has not been renamed; the original object has been orphaned and a new object (with a new GUID) has been created. Any customizations (such as manually editing the Description field) do not get transferred to the new object and the machine is in the default container unless you specify the correct OU in the adjoin command.
As a comparison, you can do the same thing with a Windows machine ad get the same results, but there is a better way. If you log onto the Windows computer with an account with Domain Admin rights and simply rename the computer, it will update the existing Active Directory object, thus retaining the same GUID, OU inheritance, customizations, etc.
It would be really handy if there were a way to accomplist that second scenario on a Mac joined to Active Directory via the Centrify agent.
4 weeks ago
I've similar issue , some times we clone osx station to another , if this was previusly joined to our domain
is impossible to successfully logon again.
- We use centrify tool to remove from domain then - Reboot
- We set new hostname then - Reboot
- We use centrify tool to join domain whit new hostsname - Seccessfully - then Reboot
- But we are unable to logon whit domain credential
But if we logon whit local user and from terminal
password password domian user name
we get OK
and domain user profile was created..
also if we try to login whit domain users from gui WORKS
But if we reboot NO Logon Again...
If we reinstall osx os works... same hostname and domain username...
4 weeks ago
Welcome to the forums.
Can you please start a new thread?
Lots of things have changed since 2015 when this thread started.
Also, make sure you provide the current software version.
Note that systems should not be cloned without leaving the domain FIRST. Then the clone needs to be renamed and rejoined to the directory.
Also note that Centrify no longer is in the OS X business with all the Mac-related products transitioning to Idaptive.