Join macOS to Active Directory

Simply execute following commands:

$ dsconfigad -domain <domain_name> -a <hostname> -u <domain_admin_user>
$ dsconfigad -groups "domain admins","enterprise admins","my custom admin group"
$ dsconfigad -mobile enable -mobileconfirm disable

The first command will join the computer to the domain. Please make sure you are using the hostname given by the hostname command, not the one defined in the sharing settings and the user which you are using for joining has the “domain admins” group by default.

The second command sets all the groups which are allowed to manage the computer

The third command is used to enable mobile logins (must be used in case the computer is not always connected to the domain, e.g. macbooks leaving the network).

More infos on apple’s page:

https://support.apple.com/en-gb/guide/directory-utility/diru11f4f748/6.3/mac/13.0

How to Change Open Files Limit on OS X and macOS

To check the current limits on your Mac OS X system, run:

$ launchctl limit maxfiles

The last two columns are the soft and hard limits, respectively.

Adjusting Open File Limits

To adjust open files limits on a system-wide basis, you must create a configuration file. It is a property list (aka plist) file in /Library/LaunchDaemons/limit.maxfiles.plist that contains the following XML configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>200000</string>
      <string>200000</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>

This will set the open files limit to 200000. The file must be owned by root:wheel and have permissions -rw-r–r–. This permissions should be in place by default, but you can ensure that they are in place by running:

$ sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist