Closed derekritchison closed 5 years ago
When we terminate a former employee we temporarily create a default routing rule that "changes the envelope recipient" from the former employee to their manager. Would be nice if I could automate this with PowerShell.
hey @derekritchison - I want to say that this isn't doable via API currently, but I'll confirm! If you happen to have a link to any of Google's API documentation that handles this already, that would help me expedite this =]
The Admin Settings API may do it, but it's also been flagged for deprecation and I'm not aware of a replacement for it yet
Thanks for the incredibly quick response. Gonna read up on that API even though it's deprecated, because I'm kinda curious.
I'll work on adding support for the current API since your desired endpoint is still up until they have a replacement for it, at which time I'll work in the replacement similar to what I did for the Gmail Inbox Delegation endpoints once they were rolled into the Gmail API
This is what we currently configure, manually, on Google Admin.
Gotcha! So, I want to say that setting up compliance rules like that are not manageable from API calls. The Admin Settings API would be able to manage your overall email route / gateway, but not those types of rules as far as I'm aware.
Yeah, pretty positive that any settings at that level are not configurable via API. What about adding in a filter to forward to the replacement recipient instead? I know it's not as direct as setting up a compliance rule as noted, but that would absolutely be configurable via existing commands in PSGSuite if desired.
I believe that would require the former employee's inbox to remain active.
It would indeed, unfortunately. At least the Gmail service. With your offboarding process, are you completely deleting the user, flipping them over to a Vault license, or something else?
Completely deleting, after doing a full .mbox export.
@derekritchison - Got it! Alright, yeah, I believe I'm a little stuck here then based on lack of public API from Google's side for that specific functionality.
Were you interested in any of the remaining Admin Settings API functionality being added? I will get them added as-is if desired, otherwise I'm going to close this out and revisit once Google adds the functionality to the Admin SDK
Understood! Would definitely be a nice feature when it's available as it would streamline our offboarding process even more. Feel free to close the thread!
That said, maybe this is off topic but I'm curious about the "Add-GSGmailFilter" command. What I'm trying to do is create a filter based on one criteria --- if a certain e-mail address appears in the "To" field. Far as I understand the command should look like this:
Add-GSGmailFilter -User
Am I missing something, or just misunderstanding the purpose of this command entirely?
No worries, that should be accurate! Are you getting an error or unexpected behavior or....?
Worth noting that if it's a non-standard LabelID (basically any label that you created yourself), you will need to pull the actual label ID first using Get-GSGmailLabel
. Self-created labels will typically have an ID that looks like Label_#
, i.e. Label_21
I see, so if I create a label for another user by running...
New-GSGmailLabel -User user@domain.com -Name
...I then have to somehow grab the unique "LabelID" before running my next step, which would be setting up that new filter?
It'll return the newly created label, so if you capture that in a variable, you can easily access the ID without querying the label list again:
You'll get a conflict if the label name already exists:
This is the error you'll see if the label ID you're trying to access doesn't exist:
Compared to a successful run where we use the actual labelID:
Great. Thanks! Been very helpful!
Happy to hear!! Let me know if you have any other questions!! Cheers!
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.