Open-AudIT https://www.open-audit.org/phpBB3/ |
|
Commas in CNs (Audit Script) https://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=5900 |
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: [code]strUserDN = Replace(strUserDN, "/", "\/")[/code] Insert this after: [code] if inStr(strUserDN(",OU=")) > 0 then delimtmp = ",OU=" elseif inStr(strUserDN(",DC=")) > 0 then delimtmp = ",DC=" else delimtmp = "," end if [/code] And amend the following 3 lines: [code] stemp = split(strUserDN, delimtmp) stemp(0) = "" ttemp = join(stemp, delimtmp)] [/code] 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 https://www.phpbb.com/ |