I want to search and replace parts of UserObject paths using regex.
If you query windows for Users in Local Groups it returns the members as in the example below. Local users are displayed with an domain related prefix and i want to find this domain prefix an delete it form local user paths.
Return Value:
\\MyDomain\PCTest\John Doe #(Local User)
\\MyDomain\Julie Doe #(Domain User)
After Formating: (how can i do this?)
\\PCTest\John Doe #(Local User)
\\MyDomain\Julie Doe #(Domain User)