Enabling Active Directory through Script

I am interested automating the enabling Active Directory (through a shell script/command, AppleScript or another way, if possible). Currently, I am using a shell command to bind the machines to Active Directory, however, I can not automate the “enabling” of Active Directory.

Any help on accomplishing this would be greatly appreciated - shell script, AppleScript, location of a file that specifies if Active Directory is enabled, etc.



The file that stores information regarding what directory plug-ins to load is “DirectoryService.plist” located at Library:Preferences:DirectoryService:
I might be wrong, but i believe that’s the only place that stores this info. Try to copy this file from a machine that has AD plug-in enabled to one that does not, restart it and check if after restart the AD plug-in is enabled or not. Please let me know…

You are exactly right. Opening the file /Library/Preferences/DirectoryService/DirectoryService.plist as root), simply retyping the word “inactive” below Active Directory and restarting does the trick. I have not yet learned VI commands well enough to edit this file.