From 9e5bdc3c5dfe0bbfc60232ebf063bf59919c87b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 29 May 2005 11:43:02 +0000 Subject: r7073: added some simple example scripts for use with smbscript (This used to be commit f1d0c006600d6d57bce2ede87a1aae0ccfc2c412) --- testprogs/ejs/ldb.js | 24 ++++++++++++++++++++++++ testprogs/ejs/loadparm.js | 19 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 testprogs/ejs/ldb.js create mode 100644 testprogs/ejs/loadparm.js (limited to 'testprogs/ejs') diff --git a/testprogs/ejs/ldb.js b/testprogs/ejs/ldb.js new file mode 100644 index 0000000000..7675197904 --- /dev/null +++ b/testprogs/ejs/ldb.js @@ -0,0 +1,24 @@ +/* + 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"); diff --git a/testprogs/ejs/loadparm.js b/testprogs/ejs/loadparm.js new file mode 100644 index 0000000000..fdeaed9d34 --- /dev/null +++ b/testprogs/ejs/loadparm.js @@ -0,0 +1,19 @@ +/* + demonstrate access to loadparm functions from ejs +*/ + +print("defined services: "); +printVars(lpServices()); + +function showParameter(name) { + print(name + ": "); + printVars(lpGet(name)); +} + +showParameter("server services"); +showParameter("netbios name"); +showParameter("security"); +showParameter("workgroup"); +showParameter("log level"); +showParameter("server signing"); +showParameter("interfaces"); -- cgit