-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gmail search syntax for Remove-GSGmailMessage #93
Comments
Hey Josh - Definitely good ideas! I use PSGSuite myself for almost the same purpose (among many other), so I completely get the goal here! For item 1 - I'll check out expanding the functionality so it's wrapped into a single command, but you can currently use the pipeline though to do it in a short one-liner (see below). Would it be worth adding in an additional Also worth noting that the pipeline support doesn't play too nice with passing the same username from one Gmail command to the next -- working on fixing that as well # Trash everything not sent directly to the user
Get-GSGmailMessageList -User "tom@domain.com" -Filter "to:-me" | Remove-GSGmailMessage -User "tom@domain.com" -Confirm:$false For item 2 - Definitely need to expand on label management! I'll work on this as I can, pull requests also very much accepted! 😄 |
Alright, everything all fixed up and about to deploy in v2.15.2!
Demo with WhatIf + Verbose showing new |
## 2.15.2 * [Pull Request #94](#94) **Thanks, [@dwrusse](https://github.com/dwrusse)!** * Added `Update-GSGmailLabel` to enable updating of Gmail label properties * Added `Update-GSGmailMessageLabel` enable updating of labels attached to Gmail messages * [Issue #93](#93) * Updated `Remove-GSGmailMessage` to include a `-Filter` parameter to allow removal of messages matching a filter in a single command * Improved pipeline support for `Remove-GSGmailMessage`
v2.15.2 has been deployed! Update and check it out, cheers! |
## 2.15.3 * [Issue #87](#87) * Fixed `Add-GSCourseParticipant` error: `"Cannot convert the "student@uni.edu" value of type "System.String" to type "Google.Apis.Classroom.v1.Data.Student"."` * Set `$request.Fields = "*"` for `Get-GSCourseParticipant` and `Get-GSClassroomUserProfile` to return all available fields for the `Profile`, including `EmailAddress` * [Issue #93](#93) * Added: `MaxToModify` parameter to `Remove-GSGmailMessage` and `Update-GSGmailMessageLabels` in the `Filter` parameter set to prevent removing/updating more messages than expected when using a filter to gather the list of messages to update. * Added: `Id` alias for `User` parameter on `Get-GSUser` for better pipeline support
Hi Nate,
I'm looking for some additional functionality that is closely related to the
Remove-GSGmailMessage
cmdlet. Specifically, feature parity with the Gmail search syntax functionality that a similar command in GAM currently has. I'd like to request one (or both) of the following features:The ability to use
Remove-GSGmailMessage
with the Gmail search syntax. For example, if I wanted to delete all messages from a particular sender (from:example@domain.com
).A new cmdlet with the ability to modify labels on a particular email (also using the Gmail search syntax). For example, if I wanted to mark all messages from a particular Gmail search syntax query as spam or trash.
You can read the documentation for the GAM commands here:
https://github.com/jay0lee/GAM/wiki/ExamplesEmailSettings#modifying-user-emails
The reason I'm looking for this functionality is that I often use these commands to combat spam or phishing. Attackers will often send several emails with different message IDs. The search syntax would allow far greater flexibility in targeting these emails. I still find myself using GAM for removing emails specifically for the ability to use Gmail search syntax.
Thoughts?
Thanks,
Josh
The text was updated successfully, but these errors were encountered: