Powershell - ADGroup list AuthOrig

JDCam
JDCam used Ask the Experts™
on
Experts,
I am brand new to powershell.. pls bare with me.

I have an ADGroup (mail group) called  '3-Everyone'. I have restrictions to who can author in this group
I add in authorized authors using this
Set-ADGroup -Identity "3-Everyone" -Add @{authOrig="CN=Mike Moore,OU=Users,OU=AB Smith,DC=absmith,DC=com"}

Open in new window


I am trying to use powershell to list back the 'authOrig' approved users but not having any luck
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
The AD PS modules by default return only a limited subset of the AD attributes.
You just need to tell Get-ADGroup to retrieve the property you need;
Get-ADGroup -Identity "3-Everyone" -Property authOrig

Open in new window

Author

Commented:
Perfect !!   I was so close.
And if i want to remove somebody, is it the same command but change -Add to -Remove ?

Author

Commented:
Wait a minute...
when we list out the AuthOrig it only shows the first 4, then ends in ......
How can I see them all?
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Yes, removing an entry would be
Set-ADGroup -Identity "3-Everyone" -Remove @{authOrig="CN=Mike Moore,OU=Users,OU=AB Smith,DC=absmith,DC=com"}

Open in new window


When you send the output to the console, it'll give you a list format, where longer entries are cut off.
You can for example, assign the result to a variable and then inspect the property you want:
$group = Get-ADGroup -Identity "3-Everyone" -Property authOrig
$group.authOrig

Open in new window

Or, if all you want is a list of the values in authOrig, without the rest of the object's properties, you can run the results through Select-Object and "expand" the property you want:
Get-ADGroup -Identity "3-Everyone" -Property authOrig | Select-Object -ExpandProperty authOrig

Open in new window

Author

Commented:
Thank you ... Perfect !!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial