I have created a powershell script that displays a column (ServerDN field) that has the following text:
/o=ABC Group/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=LAXMBGroup01/cn=Microsoft Private MDB
/o=ABC Group/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=LAXMBGroup02/cn=Microsoft Private MDB
/o=ABC Group/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=LAXMBGroup03/cn=Microsoft Private MDB
I would like to minimize this column by only displaying LAXMBGroup01, LAXMBGroup01, LAXMBGroup01.
I am thinking the key is to use a parsing command; however, I am not good with reg expressions. I would really appreciate if someone could help me resolve this issue.
This regular expression match:
'\w*(?=/cn=(\w*\s?)*$)'
e.g.
Open in new window
Or this replace:'^(/(ou?|cn)=[\w\s]*){4}/c
e.g.
Open in new window
Or this split:'/cn='
e.g.
Open in new window
Or... well the list goes on, pick the one you find least upsetting?Chris