Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

find value in string and drop everything else

$
0
0

I am trying to inventory the local computer store of my AD Domain remotely.

I am getting a comma delimited string back for the subject,and I would like to strip everything out of the string except for the value after CN=

CN won’t always be the 2nd field, it could be the first or third or fourth field.

E=bob.boberson@cityofchicago.org, CN=server1.management.chitown.local, OU=Infrastructure, O=City of Chicago, L=Chicago, S=IL, C=US 

I have no idea how to begin.

thanks,

Rogue

submitted by /u/rogueit
[link] [comments]

The post find value in string and drop everything else appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images