well, its not that easy the current implementation is in Perl modules and has a bunch of stuff that would not work without some HPES packages, but in short if you know perl here is the meat of it, you will of course have to set variables to make this work.
$ds_args = "-f -a $bindname -domain $DOMAIN -u $ACCT -p #####";
$ds_args .= " -ou $OU" if($OU);
print "$dsconfigad $ds_args
";
$ds_args =~ s/#####/$PW/;
open CONFIGAD, "$dsconfigad $ds_args 2>&1 |" or die "$progname: dsconfigad: $!
";
while(<CONFIGAD>) {
chomp;
die "$progname: $dsconfigad: $_
" if(/^Error:/);
}
close CONFIGAD;
syslog('notice', "setting bind option: passinterval
");
$ds_args = "-passinterval $PI";
$rc = system("$dsconfigad $ds_args");
die "$progname: AD binding failed
" if($rc);
syslog('notice', "setting bind option: cached accounts
");
$ds_args = "-mobile enable -mobileconfirm disable";
$rc = system("$dsconfigad $ds_args");
die "$progname: AD binding failed
" if($rc);
# disable logging in to all domains if needed
if($AllDomains) {
$sptmp = 'All Domains';
}
else {
syslog('notice', "setting bind option: alldomains disable
");
$ds_args = "-alldomains disable";
$rc = system("$dsconfigad $ds_args");
die "$progname: AD binding failed
" if($rc);
$sptmp = "$DOMAIN";
}
# set search policy
syslog('notice', "setting search policy");
$rc = system("dscl /Search -create / SearchPolicy CSPSearchPath");
die "$progname: dscl create /
" if($rc);
$rc = system("dscl /Search/Contacts -create / SearchPolicy CSPSearchPath");
die "$progname: dscl create Contacts
" if($rc);
$rc = system("dscl /Search -append / CSPSearchPath "/Active Directory/$sptmp"");
die "$progname: dscl append /
" if($rc);
$rc = system("dscl /Search/Contacts -append / CSPSearchPath "/Active Directory/$sptmp"");
die "$progname: dscl append Contacts
" if($rc);
system("defaults write $DS "Active Directory" -string Active");
--
Todd Ness
Technology Consultant/Non-Windows Services
Americas Regional Delivery Engineering
HP Enterprise Services