Use ADvalue to lookup AD path from full name (display name), samAccountName or UserPrincipalName
Top  Previous  Next


[Settings_Begin] 
BatchSettings.Delimiter=TAB 
BatchSettings.MarkerCol=4 
BatchSettings.MarkersAutoRemove=Yes 

SET ADDomainPath=dc=com/dc=acme/dc=D2 
SET ADOUPath=%col3% 
[Settings_End] 

[Machines_Begin] 
\\EDU8
[Machines_End] 

[Batch_Begin] 
Data.Loop       
 // Look up AD path for UPN   
 SET ADpath=ADValue (UserPrincipalName,%col1%@d2.acme.com,ADpath)   
  If "%ADpath%"<> Then   
   // Set logonscript    
   AD.Account.SetProperty %ADpath%, LoginScript, %col2%   
  Else   
   MessageBox "Sorry, %col1% not found in AD."
  EndIf   
Data.EndLoop   
[Batch_End] 

[Data_Begin]
account1   script3.bat      
account2   script2.bat      
account3   script2.bat      
account4   script.bat      
account5   script.bat      
[Data_End]