Mac系统管理员如果借用类似这个链接(http://www.howtomac.co.uk/?p=82)的AD bind scirpt来把Leopard/Snow Leopard加入AD域, 会发现该脚本对Lion不灵了, Lion中的Active Directory plugin相比以前系统做了很多更改,包括dsconfigad命令参数的一些变化. 自己做了一些测试,写了一个Lion bind to AD的shell脚本. 内容如下,Mac系统管理管理员可根据需求进行更改或拓展脚本满足自己环境的要求.
#!/bin/sh
# Active Directory Bind Script For Lion Client
# Modified by Wade Wei according to previous popular bind script
#Basic parameters
computerid=`scutil --get LocalHostName`
domain="contoso.com"
udn="macbinder"
password="afp54801!"
ou="OU=maccomputers,DC=contoso,DC=com"
#Advanced parameters
alldomains="enable"
localhome="enable"
protocol="smb"
mobile="enable"
mobileconfirm="disable"
useuncpath="enable"
user_shell="/bin/bash"
preferred="ad1.contoso.com"
admingroups="CONTOSO\Domain Users"
localadmin="maclocaladmin"
localpwd="mac01!"
ksauthority="enable"
namespace="domain"
packetsign="require"
packetencrypt="require"
# Bind to AD
dsconfigad -add $domain -username $udn -password "$password" -computer $computerid -ou "$ou" $preferred -force -localuser $localadmin -localpassword "$localpwd" -packetencrypt $packetencrypt
sleep 5
#Configure advanced options
dsconfigad -localuser $localadmin -localpassword "$localpwd" -alldomains $alldomains -localhome $localhome -groups "$admingroups" -mobile $mobile -mobileconfirm $mobileconfirm -namespace $namespace -packetsign $packetsign -useuncpath $useuncpath -protocol $protocol -shell $user_shell -authority $ksauthority
echo "Bind done"
exit 0