# Binding and Unbinding to Active Directory from Mac OS via Command Line - Open the Terminal Application - Type in `sudo -i` and type in your Mac Administrator account password. `sudo` gives you root level or administrator level privileges. #### To View current Active Directory Settings > dsconfigad -show #### To Unbind a Computer from an Active Directory Domain > dsconfigad -remove -username `` -password `` [-localuser `` -localpassword ``] _Note: `` needs to be replaced with domain administrator who has binding/unbinding rights._ * * * #### To Bind a Mac Laptop Computer to an Active Directory Domain `` --> replace this with the computer name you want to bind to Active Directory `` --> needs to be replaced with domain administrator who has binding/unbinding rights. `` --> replace with domain you want to join. > dsconfigad -add `` -computer `` -username `` -password `` -ou "CN=Computers,DC=network,DC=example,DC=com" [-force] [-localuser `` -localpassword ``] -mobile enable -mobileconfirm enable -localhome enable -useuncpath enable -protocol smb -groups "Domain Admins,Enterprise Admins" -alldomains enable -packetsign require -packetencrypt require * * * #### To Bind a Mac Desktop Computer to an Active Directory Domain `` --> replace this with the computer name you want to bind to Active Directory `` --> needs to be replaced with domain administrator who has binding/unbinding rights. `` --> replace with domain you want to join. > dsconfigad -add `` -computer `` -username `` -password `` -ou "CN=Computers,DC=network,DC=example,DC=com" [-force] [-localuser `` -localpassword ``] -localhome enable -useuncpath enable -protocol smb -groups "Domain Admins,Enterprise Admins" -alldomains enable -packetsign require -packetencrypt require