How do I remove Inherited Permissions on an Address List using PS1

I need to remove Inherited Permissions from and Address List.  Specifically the Address list allows Authenticated Users to List Contents.  I dont want them to.  I know i can do it through the GUI just fine.. I just want to program the task.

I know i have to start with
Remove.ADPermission $MyContainer -user "Authenticated User"
but the syntax to first remove inherit parent properties and to remove the "LIst Contents" permissions are evading me. I also dont want it to prompt me to confirm.. just do it

Can anyone help with this line of code?  or a better way or deny system?  Just needs to be automatic and not prompt me
brandonjelAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SurajConnect With a Mentor Commented:
Run the following command:

get-adpermission "All Address Lists" | Where {($_.User -like 'NT Authority\Authenticated Users') -and ($_.IsInherited -eq $True)} | Remove-ADPermission

Thanks,
x-sam
0
 
brandonjelAuthor Commented:
thanks man.. perfect
0
All Courses

From novice to tech pro — start learning today.