Solved

finding distribution groups/sec groups full control

Posted on 2014-09-17
3
177 Views
Last Modified: 2014-09-19
get-distributiongroup -organizationalunit  "CN=marketing,CN=Users,DC=contoso,DC=com" | get-adpermission | where { ($_.accessrights -match 'write' ) -or ($_.AccessRights -eq 'GenericAll')

I have a script where I am trying to pull all groups with full control permissions and then add them as owners to those same distribution groups/security groups. If someone can show me first how to pull all the groups with full control as multi valued objects then I think I can get around using the set-distribution group as reading them back in.
0
Comment
Question by:techdrive
3 Comments
 
LVL 12

Accepted Solution

by:
SreRaj earned 500 total points
ID: 40329927
Hi,

Please try following command.

get-distributiongroup -organizationalunit  "OU=marketing,OU=Users,DC=contoso,DC=com" | get-adpermission | where { $_.accessrights -match 'write' -or $_.AccessRights -match 'GenericAll' -and $_.user -notlike '*exchange*' -and $_.user -notlike '*system*' -and $_.user -notlike 's-1*' -and $_.user -notlike '*admins*' -and $_.user -notlike '*organization*' -and $_.user -notlike '*self*' -and $_.user -notlike '*administrators*' } | select identity,user,accessrights

This does not give result as multi-valued attribute, but it gives as a list. Also, please check the distinguished name for OU. Names of OU, you have to prefix with 'OU' not with 'CN'.
0
 

Author Comment

by:techdrive
ID: 40330475
thank you and what if I wanted to append a group to this. Meaning while I am looking for groups with full control add another group with full control and or access to managedby.
0
 
LVL 3

Expert Comment

by:Phil Bossman
ID: 40331846
This TechNet article shows how to add and remove sinlge entries to a DistributionGroup

0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
A procedure for exporting installed hotfix details of remote computers using powershell
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now