Create MacOS

Example for joining MacOS from a script
This commit is contained in:
PierreGode 2018-09-25 13:47:03 +02:00 committed by GitHub
parent 3ff1c8d620
commit 195a2eb430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
MacOS Normal file
View File

@ -0,0 +1,14 @@
#this is a vary simple scipt to automate MacOS AD join
#Note that Apple is going away from AD
#Recomended solution is Nomad https://nomad.menu/products/#nomad
# to automate ADjoin check the variables below and find a solution to get "next computerobject"
DOMAIN=$(test.com) ## Domain
admin=$(admin) ## AD admin
pass=$(password) ## AD admin pass
adgroup=$(whatevergroup) ## this is to give admin privileges to a group
ADcomputer=$() ## 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=$() ## 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