I have searched the stacks fairly thoroughly to find a scripting language-based command that can help me develop a script to be executed on Macs capable of actually generating (NOT SIMPLY BINDING) those Macs as computer objects in Active Directory. I have found several excellent scripts that BIND Macs, but THEY ONLY BIND THE COMPUTER WHEN THE COMPUTER OBJECT HAS BEEN PREVIOUSLY GENERATED IN ACTIVE DIRECTORY. I have a working script that functionally unbinds and then binds a computer to AD, but only when a computer object is already present AND the computerName variable given during the bind runtime matches the name of that computer object already present in AD. All of the scripts that I've seen, and the one that I have been using, use the BASH dsconfigad utility, but this does not actually delete or generate computer objects (at any privilege level).
1 Answer
The Directory Services Configuration for Active Directory Utility (DSCONFIGAD), developed and offered by Apple, is fully capable of generating and binding Active Directory computer objects. OS X utility commands such as DSCL, DSCACHE, DSCONFIGAD, DSEDITGROUP, etc., however, must be executed as Root. Initially, I failed to do this, hence my question and confusion above, both of which have been resolved.
dsconfig -add
) should create a computer object if none exists. You need to troubleshoot why this is not happening, rather than looking for a different command.