1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/testprogs/ejs/ldb.js
2007-10-10 13:17:12 -05:00

25 lines
508 B
JavaScript

/*
demonstrate access to ldb databases from ejs
*/
println("Trying a attribute constrained search on samdb");
var dbfile = lpGet("sam database");
var attrs = new Array("name", "dnsDomain", "objectSid", "dn");
res = ldbSearch(dbfile, "(objectClass=domain)", attrs);
printVars(res);
println("and now an unconstrained search");
var dbfile = lpGet("sam database");
res = ldbSearch(dbfile, "(objectClass=user)");
printVars(res);
println("and a bad search");
res = ldbSearch("foo");
println("all done");