Forum Replies Created
-
AuthorPosts
-
ptrondsen
ParticipantI was getting the node error in the final beta, and had to go back to the previous version first, and then go to gm to get it to work. I think they fixed that in the final release.
ptrondsen
ParticipantI got mine from Snow Leopard to work.
It’s based on the Bombich script, I had to modify a few things.
In order to get it to work in Snow Leopard and Lion, I had to add a few sleeps at the end.
Good LuckScript:
#! /bin/sh
clear
# User input
# Check to see if root
amiroot=`whoami`
if [ $amiroot != root ]; then
echo “”
echo “ERROR! You must sudo to root to use this script”
echo “”
exit 1
fiunit=Begining of AD NAME
ou=”OU=”### Getting Computer Name
g=0
while [ “$g” -eq 0 ]
doprintf “\nEnter Username: ”
read name
echo $name
if [ $? -eq 0 ]; then
g=`expr $g + 1`
else
echo “Invalid input, please renter asset number”
fi
done####End Computer Name
printf “\nEnter AD account that has rights to bind computers to AD: ”
read udn
printf “Enter password: ”
stty -echo
read password
stty echo
# Standard parameters
domain=”yourdomain.com” # fully qualified DNS name of Active Directory Domain
orgname=`scutil –get ComputerName`
computerid=${unit}${name}
printf “%16s\t%16s\n” “$orgname” “$computerid”> /tmp/”$unit.txt”
#exit
scutil –set HostName $computerid
scutil –set ComputerName $computerid
scutil –set LocalHostName $computerid
#computerid=`echo “$up” | tr ‘a-z’ ‘A-Z’`;exit# Advanced options
alldomains=”enable” # ‘enable’ or ‘disable’ automatic multi-domain authentication
localhome=”enable” # ‘enable’ or ‘disable’ force home directory to local drive
protocol=”smb” # ‘afp’ or ‘smb’ change how home is mounted from server
mobile=”enable” # ‘enable’ or ‘disable’ mobile account support for offline logon
mobileconfirm=”disable” # ‘enable’ or ‘disable’ warn the user that a mobile acct will be created
useuncpath=”disable” # ‘enable’ or ‘disable’ use AD SMBHome attribute to determine the home dir
user_shell=”/bin/bash” # e.g., /bin/bash or “none”
preferred=”-nopreferred” # Use the specified server for all Directory lookups and authentication
# (e.g. “-nopreferred” or “-preferred ad.server.edu”)
admingroups=”Your ADMIN GROUPS”,
printf “\nComputer is being added to Active Directory with a name of “$computerid” please wait.\n ”
### End of configuration
# Activate the AD plugin
defaults write /Library/Preferences/DirectoryService/DirectoryService “Active Directory” “Active”
plutil -convert xml1 /Library/Preferences/DirectoryService/DirectoryService.plist
# Bind to AD
dsconfigad -f -a $computerid -domain $domain -u $udn -p “$password” -ou “$ou”
sleep 15# Configure advanced AD plugin options
if [ “$admingroups” = “” ]; then
dsconfigad -nogroups
else
dsconfigad -groups “$admingroups”
fidsconfigad -alldomains $alldomains -localhome $localhome -protocol $protocol \
-mobile $mobile -mobileconfirm $mobileconfirm -useuncpath $useuncpath \
-shell $user_shell $preferredsleep 10
dsconfigldap -v -a yourodserver
sleep 15
dscl /Search -create / SearchPolicy CSPSearchPath
dscl /Search/Contacts -create / SearchPolicy CSPSearchPathsleep 30
dscl /Search -append / CSPSearchPath “/Active Directory/All Domains”
dscl /Search -append / CSPSearchPath /LDAPv3/yourodserversleep 15
dscl /Search/Contacts -append / CSPSearchPath “/Active Directory/All Domains”
dscl /Search/Contacts -append / CSPSearchPath /LDAPv3/yourodserver# Restart DirectoryService (necessary to reload AD plugin activation settings)
killall DirectoryServiceexit 0
-
AuthorPosts
Recent Comments