Author Posts

May 31, 2017 at 1:10 pm

Hi all,

In our AD, unfortunately we have several groups that contain a '/' in their names. When running the get-adprincipalgroupmembership cmdlet this causes an error if a user is a member of such a group. Is there a way to get all groups displayed that do not have the '/' character in their names?

Here's the cmdlet I've been using:

Get-ADPrincipalGroupMembership username | select name | sort name

Thanks in advance.

May 31, 2017 at 2:08 pm

Yes, I'm aware. But changing the group names is not an option right now, so that's why I was wondering if and how to workaround it.

May 31, 2017 at 7:16 pm

Could you get around the issue by searching on a particular user instead of a Group?

Get-ADUser -Identity SomeUsername -Properties memberOf | Select-Object -ExpandProperty memberOf

It would take a bit more work and some logic to filter for a particular group(s), but might get you where you need to be.

June 1, 2017 at 10:51 am

Yes this is what I need, thanks. Now all I need is to format it nicely.