# email users with fullaccess

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 5 years, 4 months ago.

• Author
Posts
• #5637

by totalnet32 at 2013-03-06 16:24:04

I was hoping to email all users that have full access to shared mailboxes on one particular storage group. I need to see if I can delete shared mailboxes that are not needed. they are just regular mailboxes used for mass mailing.

I was thinking of using powershell to export all mailbox names with full access Permission and then have send-message email users with a "canned email"
With having a txt file i can test/control when and what user receive the email.

[PS] Get-Mailbox -ResultSize unlimited -database 'server\storage\db01'| Sort-Object -Property Identity | Get-MailboxPermission | where { ($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false) -and -not ($_.User -like "N
T AUTHORITY\SELF") } | ft identity, user > c:\temp\text.txt

I would need the identity field to be in the subject and the user property in the TO field.
The foreach-object is giving me an issue.
please help

by DonJ at 2013-03-07 08:07:21

It's harder because you're trying to cram it all into a one-liner. And then formatting it into a table and sticking it in a text file ;).

$mailboxes = Get-Mailbox -ResultSize unlimited -database 'server\storage\db01'| Sort-Object -Property Identity | Get-MailboxPermission | where { ($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq$false) -and -not ($_.User -like "NT AUTHORITY\SELF") }   foreach ($mailbox in $mailboxes) { # do something with$mailbox}

That's probably an easier pattern to work with. You can work with each mailbox individually in \$mailbox that way.

You must be logged in to reply to this topic.