-
Notifications
You must be signed in to change notification settings - Fork 4
/
adJoin.sh
executable file
·40 lines (28 loc) · 1.17 KB
/
adJoin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# Join Active Directory and configure plugin settings
#
# Created by Amsys
#
# Use at your own risk. Amsys will accept
# no responsibility for loss or damage
# caused by this script.
############## Set Variables
adAdmin="adadmin"
# Set the AD Domain Admin username - DO NOT leave these in place when not using the script!
adPass="yourpw"
# Set the AD Domain Admin password - DO NOT leave these in place when not using the script!
adDomain="domain.com"
# Set the AD Domain name, e.g. myaddomain.local
# though PLEASE don't use .local for your AD domain, that's just asking for trouble!
adOU="CN=Computers,DC=domain,DC=com"
# Set the OU for the machine to be put into. E.G.:
# "OU=Macs,OU=Computers,DC=mydomain,DC=Local" DO remember to put it in quotes
computerName=$(/usr/sbin/scutil --get LocalHostName)
# Set the current computer name as a variable
############## Join AD
dsconfigad -force -add "$adDomain" -computer "$computer" -username "$adAdmin" -password "$adPass" -ou "$adOU"
# Join AD
dsconfigad -sharepoint disable -useuncpath disable -passinterval 0 -mobile enable -mobileconfirm disable
# Configure plugin settings
############## Script complete
exit 0