good morning. i am trying to avoid GUI at my job to practice powershell and one of the daily tasks i have is to check if a user was added to the right groups so i was using the cmdlet:
get-aduser $username -Properties memberof | select -expand memberof
and im getting a list of the groups the user is in. but i get it like that :
CN=GroupName,OU=OU,OU=another OU,etc...
and i want it just to output the CN value if i would have to do that in bash i would grep it, is there any way to "grep" in powershell? or isolate the CN so it would output only that?