Suggestion for new Utility

May 26, 2011 at 3:35 PM

Ryan,

I have a suggestion for a new utility that I as well as other may find very usefull. I am looking for a way to find text in a string using regex and output the text found by the regex to published data. For instance when using your Active Directory OIP i am enumerating objects in an OU and it is returning their full path names i.e. "LDAP://CN=SERVERNAME,OU=CONTAINER1,OU=CONTAINER2". In order for me to act on this in other functions such as adding agents in SCOM to the servers which do not currently have agents i have to get just th server name due to the other OIP's not accepting the LDAP full name. so i'm using the find/replace text function to find the "LDAP://CN=" and replace it with "". Then I am using a second find/replace text and eliminating the ",OU=CONTAINER1,OU=CONTAINER2" which unfortunately changes depending on what OU i was using. By leverating a RegEx string such as "(?<=CN=)(\w|\d)+" I could return just the Servername portion of the string and be able to cut a few actions out of my workflow.

If there is already a way to do this and I am just unaware of it please tell!!!

Anyhow, just some food for thought.

Thanks!!!

Ryan

Coordinator
May 27, 2011 at 7:45 PM

Hey Ryan,

I agree that a 'regex' object would be pretty cool.  I will add it next time I upate this integration pack.  For now though i'd suggest you check out the built-in data manipulation functions in opalis http://opalis.wordpress.com/2010/12/13/data-manipulation-functions-2/ or look to use the 'split string' object in this integration pack to fufill your needs.  To grab the 'SERVERNAME' portion from the LDAP Path put '=,' as the delimiters for Split String and choose index 1.  Spliting on ',=' for that string will yield an array of

Array Index     -       String

0                   -       LDAP://CN

1                   -       SERVERNAME

2                   -       OU

3                   -       CONTAINER1

4                   -       OU

5                   -       Container2

Hopefully this makes sense!

 

May 27, 2011 at 8:01 PM

Yes, that makes sense and a good way to do that, I didn't think of that way. Alernatively what i did was just use the Get Object Property Value to pull the CN from your other IP to get the servername minus the rest of the full LDAP string. Thanks for your help!