forked from PierreGode/Linux-Active-Directory-join-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MacOS.sh
17 lines (15 loc) · 1.17 KB
/
MacOS.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#this is a very simple scipt to automate MacOS AD join
#Note that Apple is going away from AD
#Recomended solution is Nomad https://nomad.menu/products/#nomad
echo "this script needs to be configured to funktion"
echo "if you already did it then edit this file and uncomment row 6 with a # in the beginning"
exit
# to automate ADjoin check the variables below and find a solution to get from you AD or just type the name of next object in list "next computer object"
DOMAIN=$(test.com) ## Domain
admin=$(admin) ## AD admin
pass=$(password) ## AD admin pass
adgroup=$(whatevergroup) ## this is to give admin privileges to a group in the active directory ex: MacAdmins
ADcomputer=$(MACagent01 ) ## desired computer object name ( this will only be the name of the computer object in Active Directory, hostname is still the same as default)
OU=$(OU=Computers Mac,DC=domain,DC=com) ## desired OU were the computer object is created
sudo dsconfigad -add $DOMAIN -mobile enable -mobileconfirm disable -localhome enable -protocol smb -shell '/bin/bash' -username $admin -password $pass -groups $adgroup -computer $ADcomputer -ou $OU
sudo dsconfig -show