Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Strings Strings Strings

$
0
0

I have to add hundreds of users to a new AD Security Group.  I have a script that will add them but my script only works if I have the samAccount (login ID).      Example:   PublicJQ     Now, I have a .TXT file with about 500 users and they are in this format.

Public, John <PublicJQ @ Acme.com>     (I had to add the spaces around the @ to preserve the <>  signs but there are actually no spaces in the list)

How do I strip off everything from < to the Left and then strip off everything from @ to the Right?   So I'm left with just the users Login ID?

 

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles