Last active
July 6, 2016 15:17
-
-
Save WildDogOne/e6427eb554e9f6f96e64 to your computer and use it in GitHub Desktop.
exchangeManagement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Delete all mails in every mailbox with the Subject "Summer Offer" | |
Get-MailBox | Search-Mailbox -SearchQuery "Summer Offer" -DeleteContent | |
#Alternative | |
Get-Mailbox -Server "*Server*" | Search-Mailbox -SearchQuery 'Subject:"*Subject*" and Body:"*Body*"' -DeleteContent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Start and End need to be in the US Format for some odd reason, IF you want to scan only a fraction of one day | |
Get-Messagetrackinglog -Recipients: markus@müller.ch -Start "12/31/2015 06:00:00" -End "12/31/2015 7:00:00" |ft -autosize Timestamp, Source, Sender, Recipients, MessageSubject | |
Get-Messagetrackinglog -Recipients: markus@müller.ch -EventID "RECEIVE" -Start "12/31/2015 06:00:00" -End "12/31/2015 7:00:00" |ft -autosize Timestamp, Source, Sender, Recipients, MessageSubject | |
Get-Messagetrackinglog -Recipients: markus@müller.ch -EventID "FAIL" -Start "12/31/2015 06:00:00" -End "12/31/2015 7:00:00" |ft -autosize Timestamp, Source, Sender, Recipients, MessageSubject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List all the permissions | |
Get-PublicFolderClientPermission | |
#If you want to add a user to a default group like owner or editor, but the user already has permissions | |
#you will have to remove them first, what a hassle | |
Remove-PublicFolderClientPermission -Identity "\Public Foldername" -user Username | |
#now to add one or more permissions | |
Add-PublicFolderClientPermission -Identity "\Public Foldername" -user Username -AccessRights Owner | |
#Now for some automation | |
$folders = Get-PublicFolder -identity "\Public\folder\path" -Recurse | |
foreach ($folder in $folders){ | |
Add-PublicFolderClientPermission -identity $folder -user "userName" -AccessRights Owner | |
} | |
$folders = Get-PublicFolder -identity "\Public\folder\path" -Recurse | |
foreach ($folder in $folders){ | |
Remove-PublicFolderClientPermission -identity $folder -user "userName" -confirm:$false | |
Add-PublicFolderClientPermission -identity $folder -user "userName" -AccessRights Owner | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment