[Settings_Begin]
BatchSettings.Delimiter=;
BatchSettings.MarkerCol=12
BatchSettings.MarkersAutoRemove=Yes
SET ADDomainPath=dc=com/dc=acme/dc=D31
SET NDPath=OAK\MyOrg\MyOU
[Settings_End]
[Machines_Begin]
\\MAIN04
[Machines_End]
[Init_Batch_Begin]
// Get data from Novell
Data.Get.ND Container,%NDPath%,user,yes,NDSPath§1§Telephone Number§3§given name§4§surname§5§Initials§6§internet eMail address§7§
// Use telephone number property to find AD path (telephone number must be same in both Novell and Windows)
SET Found=0
SET Failed=0
Data.Loop
Set ObjectPath=ADpathFind (%ADDomainPath%,user,telephonenumber=%col3%,Yes)
If "%ObjectPath%"<> Then
// if AD path found - write it in second column, increase number of found counter
Data.Write 2, %ObjectPath%
inc (%Found%)
Else
// if AD path not found - write "Failed" in second column, increase number of failed counter
Data.Write 2, Failed
inc (%Failed%)
EndIf
Data.Endloop
// User feedback
if %Found%=0 then
MessageBox "Sorry, no accounts found".
QuitBatch
Else
MessageBox "%Found% found, %Failed% not found, continue?", Ask
IF %LastMessageBox%<>Yes Then
QuitBatch
EndIf
EndIf
[Init_Batch_End]
[Batch_Begin]
// Use AD path in second column to write data to Windows AD
Data.Loop
SET ObjectPath=%col2%
if "%ObjectPath%"<>Failed Then
AD.Account.SetProperty %ObjectPath%, FirstName, %col4%
AD.Account.SetProperty %ObjectPath%, Initials, %col6%
AD.Account.SetProperty %ObjectPath%, LastName, %col5%
AD.Account.SetProperty %ObjectPath%, EmailAddress, %col7%
EndIf
Data.Endloop
[Batch_End]
[Data_Begin]
[Data_End]