Commas in CNs (Audit Script)
Page 1 of 1

Author:  Matt-LTS [ Fri Jul 06, 2012 6:03 pm ]
Post subject:  Commas in CNs (Audit Script)

First off, thank you for building this software - it fits what I needed here perfectly. :)

I've started testing OAv2 at my site and I ran into a little problem with the audit script (v8_2) due to our naming conventions. I've listed the problem and my quick hack below in case anyone finds it useful.

Here, the CN of a user object is usually named in the format <Forename>, <Surname>. This causes problems when the script tries to generate a base DN from the current user's DN by splitting on commas.

Since the purpose of that section is to simply strip out the User's CN portion from the string I worked around it as follows:

At around line 723:
strUserDN = Replace(strUserDN, "/", "\/")

Insert this after:
if inStr(strUserDN(",OU=")) > 0 then
      delimtmp = ",OU="
elseif inStr(strUserDN(",DC=")) > 0 then
      delimtmp = ",DC="
      delimtmp = ","
end if

And amend the following 3 lines:
stemp = split(strUserDN, delimtmp)
stemp(0) = ""
ttemp = join(stemp, delimtmp)]

The script has been working perfectly for me since that change when run against accounts with and without commas in their CNs. There's probably a better way (maybe with RegExs?) but this was good enough for my purposes!

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group