Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

how to split a non-fixed size string

$
0
0

Hi Guys

I have a lots of user account SIDs string like , what i want is to get the string between the first " and the first"," symbol

$string = "S-1-5-XXXXX-XXXXX-XXXX-XXXX,CN=contoso,CN=com"

for simplicity , i need to get the S-1-5-xxx-xxxx-xxxx-xxxx from the $string , how can i achieve this ?




Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>