This script extracts all accounts with both "userPassword" and "sambaNTPassword" attributes from the OU "People" on LDAP server "my-domain.com" to the [Data] section, generates random pronounceable passwords and sets both the Linux and the Samba password for all accounts.
// LDAP server, SSL must be enabled on port 636, a SSL certificate must be installed locally
SET LDServer=ldap4.my-domain.com
SET LDAdminAccount=%LDDomainPath%/cn=ldapman
SET LDAdminPW=password
SET LDDomainPath=dc=com/dc=my-domain
SET LDOUPath=%LDDomainPath%/ou=People
[Init_Batch_Begin]
Lin.DS.Logon %LDServer%, %LDAdminAccount%, %LDAdminPW%
// Get users with both userPassword and sambaNTPassword
Data.Get.LD.Find %LDOUPath%, (&(objectClass=posixAccount)(userPassword=*)(sambaNTPassword=*)), yes, LDpath§1§
Data.Passwords.Generate Special
Data.Show
[Init_Batch_End]