SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
234 stars 68 forks source link

Get-GSGmailSignature ... Update-GSGmailSignature #378

Open eugen257 opened 1 year ago

eugen257 commented 1 year ago

Hello, i need help. I need to change the signature of more than a hundred accounts. With this in mind, I have a few questions:

Thanks in advance

Buenno commented 10 months ago

The Gmail API is a little quirky in that you can only create signatures by assigning them to a sendas address, it's not like the UI where you can create a signature on it's own or assign fancy names to the signatures. If you are trying to update the default signature for every user in your domain then that's easy.

You can use Get-GSGmailSendAsAlias or its alias Get-GSGmailSignature to get a users aliases which will include the signatures. It won't show you the name of the signature as seen in the UI, this is because the Gmail API doesn't return such data.

You can update/change the signature with Update-GSGmailSignature. For changing the default signature the command will look something like Update-GSGmailSignature -User username -SendAsEmail username@domain.com -Signature "html sig goes here".

You can remove signatures for an alias via Update-GSGmailSignature, just set the signature property to an empty space. e.g. Update-GSGmailSignature -User username -SendAsEmail username@domain.com -Signature " ". This isn't required if you plan on updating the signature for the same sendas address.

Why is it not possible to view existing signatures and the ability to select the required one? I'm not sure what you mean by this. You can view all signatures and update/remove whichever one you need.

How to assign the ' ReplyToAddress' parameter? You can't via the API.