Archivo para la categoría ‘Exchange Online’

SendAs and SendOnBehalfOf with Exchange Online via PowerShell

viernes, 11 de enero de 2013 Sin comentarios



Sometimes, there are situations where recieving department messages is not sufficient via distribution groups, but also exists the need to answer them or even write new ones using the department address and not from the personal assigned mailbox… For that, Microsoft has brought some Cmdlets that we can use with PowerShell: SendAs and SendOnBehalfOf.

So lets begin telling the differences between them:

SendAs: It let us send messages using the department address (i.e: from the personal assigned mailbox (i.e: , this way, the destinatary will recieve the sent message with the department name as the sender.

This method is really useful in situations where we have two personal addresses inside the organization (i.e: an alias) and don´t want to spend on another license to use with a new mailbox…

Also, if what we want is to set a rule where the personal assigned mailbox cannot send messages outside the organization except if the message is sent using the department address, this method is the solution for it.

SendOnBehalfOf: It let us send messages On Behalf Of the company department (i.e: on behalf of, this way the destinatary will recieve the message with the sender as “User on behalf of department» (i.e: John Summer on behalf of Contoso Administration Department).

This method is really useful when what we want is to let know the destinatary who sent the message inside the company department, or who did the reply, and all the department recieve the reply when the destinatary does it.

Well once this is all cleared, lets explain the process for doing this with both methods. Lets keep in mind that to do so, we must have our PowerShell environment prepared for administrating Office365 services



  • For use with one specific user:

$LIveCred = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LIveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session

Add-RecipientPermission -AccessRights SendAs -Trustee -Confirm:$false

  • For use with Security or Distribution Groups:

Add-RecipientPermission -AccessRights SendAs -Trustee -Confirm:$false

  • Viewing the SendAs permissions applied on the organization:

Get-RecipientPermission | where {($_.Trustee -ne ‘nt authority\self’) -and ($_.Trustee -ne ‘null sid’)}

  • Viewing the SendAs permissions applied to a specific user:

Get-RecipientPermission –Trustee

  • Revoke SendAs permissions to a specific user:

Remove-RecipientPermission -AccessRights SendAs –Trustee



  • For use with one specific user:

$LIveCred = Get-Credential$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LIveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session

Set-DistributionGroup -GrantSendOnBehalfTo

The only problem with this code is that when we run it again for another user, this last execution will replace the previous one (always with the same department) and will be the only one to send on behalf of the department. To avoid this problem here´s a workarround:

$a = Get-DistributionGroup

$b = Get-User

$a.GrantSendOnBehalfTo += $b.DistinguishedName

Set-DistributionGroup -GrantSendOnBehalfTo $a.GrantSendOnBehalfTo

Get-DistributionGroup | fl name,grant* > List_SendOnBehalfOf_assigned_permissions_on_department.txt

This way we can add users to Send On Behalf Of in nested mode, but instead it will require to run this code each time we want to add another user and the administration task will be some lines more to achieve our goal…

  • For use with Distribution and Security Groups: This is the best option, it´ll sabe us administration time, avoiding unnecessary lines in our PowerShell each time a new user enters a department…

$a = Get-DistributionGroup

$b = Get-DistributionGroup «Distribution Group»

$a.GrantSendOnBehalfTo += $b.DistinguishedName

Set-DistributionGroup -GrantSendOnBehalfTo $a.GrantSendOnBehalfTo

Get-DistributionGroup | fl name,grant* > List_SendOnBehalfOf_assigned_permissions_on_department.txt

I´ve added the «> List_SendOnBehalfOf_assigned_permissions_on_department.txt» on the last line to know who has SendOnBehalfOf permissions inside the department and send it to whoever asks for it (i.e: our IT Manager)

Once this is done, the user will only have to specify the address from where he wants to send the message inside OWA or Microsoft Outlook.

In Microsoft Outlook (if the user doesn´t have more than one account configured) we must enable the «From:» field inside a new E-Mail – Options – From: (above «show fields») and then we can specify the address where we want to send the message from typing it after clicking in «Othe E-Mail address»

Inside OWA occurs the same thing, and we must proceed the same way to enable de From: field.

How to append a disclaimer in Exchange Online

domingo, 6 de enero de 2013 Sin comentarios


On this post, i´ll explain how to configure a disclaimer on our Exchange Online subscription.

Even though you can configure it as part of the signature in our Outlook, this tutorial is specially good for companies with many pcs and users on one or more sites.

It´s good to say that this procedure covers all that an outlook signature can´t, i.e, mobile devices like BlackBerry, Android, Windows Phone, IPhone, etc… that have the Exchange account configured, when sending e-mails, automatically append the disclaimer, and don´t write it every time we configure each one of our devices (including OWA).

It´s precise to remark before you continue reading this article, that the options we´ll be using, will only be available on E1, E2, E3, E4 and Exchange Online Plan 1 subscriptions. If we have an Office365 P1, we wont have those options available because that feature is not available on small and mid-sized company plans.

Once cleared this off, lets proceed creating our disclaimer on our Office365 environment.

  • First of all, access the administration portal , using the admin credentials.
  • Once inside, go to «Manage» just under «Exchange» on the center area.
  • It will open the Exchange Administration console of our company, then click where it says «Mail Control«
  • Then go on and click on the button where it says «New«, in order to create a new rule.
  • It will open a new windows where we can choose conditions, actions and set the name of the rule. We´ll begin setting the condition «If: the recipient is…» and select «Outside the Organization«.
  • Then select the action to take if the condition is made. On our case we will select «Apply a disclaimer to the message» and «Append a Disclaimer».
  • Click on «Enter Text» and write the text we want to appear on the disclaimer
  • Then on Select One and «ignore«.
  • Indicate a name to the rule i.e: «Disclaimer» and with all this, we have our disclaimer configured. Besides we still have to do something else to avoid a disclaimer nesting within a conversation, so lets click on the text where it says «More Options» to enable the exceptions.
  • On this area, select the option «Except if…: the subject or the body…» and select the option «the subject contains one of this words…«
  • A new window will open, where we can add the following words (including the «:») «Re:» y «Fw:» to avoid appending any disclaimer on answers and forwards.
  • Accept and Save the rule, and from this moment we will have our disclaimer working.

Add an image as a signature inside OWA on Exchange Online

sábado, 5 de enero de 2013 Sin comentarios


In this post i will teach you how to insert an image to use as a signature inside OWA on Exchange Online, so lets begin:

In order to do so, we will need to make some workarounds to beat the system, because Microsoft doesn´t support officially or at least in a clear way this feature.

  • The first thing will be pick our image or logo (my contact info in my case including my company logos as a single image) and upload it to any web server (i upload it inside a folder named «signatures» hanging out the root folder of my website).
  • The second thing will be, open the url where the image is located inside any web browser (including the whole http:// stuff, in example:
  • Right Click on the displayed image in click on «Copy»
  • Access our OWA ( and click on where it says «Outlook«.
  • Click on «options» and then on «see all options«
  • Then on «Settings» and where it says «E-Mail Signature», type the preceding text (i.e: «Cheers:» , «Sincerely yours»…) and then paste the previously copied image using the combination keys (Ctrl+v). Note that there´s no button labeled «paste» and that the context menu doesn´t work neither inside the signature area…
  • And finally just mark the checkbox where it says «Automatically include my signature on messages I send» and then click on «Save» at the bottom of the page.



From now on, all the outgoing messages sent using OWA, will be sent with the desired signature including the image ;).