#Set HTML signature
if (-not $owaUserOptions.Dictionary.ContainsKey("signaturehtml")) {
if (-not [System.String]::IsNullOrEmpty($HtmlSignature)) {
$owaUserOptions.Dictionary.Add("signaturehtml",$HtmlSignature)
}
} else {
if (-not [System.String]::IsNullOrEmpty($HtmlSignature)) {
if ($Force) {
$owaUserOptions.Dictionary["signaturehtml"] = $HtmlSignature
} else {
$warningMsg = $Messages.ExistingHtmlSignature
$PSCmdlet.WriteWarning($warningMsg)
}
} else {
$owaUserOptions.Dictionary.Remove("signaturehtml") | Out-Null
}
}
#Set HTML signature if (-not $owaUserOptions.Dictionary.ContainsKey("signaturehtml")) { if (-not [System.String]::IsNullOrEmpty($HtmlSignature)) { $owaUserOptions.Dictionary.Add("signaturehtml",$HtmlSignature) } } else { if (-not [System.String]::IsNullOrEmpty($HtmlSignature)) { if ($Force) { $owaUserOptions.Dictionary["signaturehtml"] = $HtmlSignature } else { $warningMsg = $Messages.ExistingHtmlSignature $PSCmdlet.WriteWarning($warningMsg) } } else { $owaUserOptions.Dictionary.Remove("signaturehtml") | Out-Null } }
Example 1: How to display help about Set-OSCEXOEmailSignature
To display help about this function, please run this command.
Get-Help Set-OSCEXOEmailSignature -Full
Example 2: How to initiate a connection to Office 365 Exchange Online.
To initiate a connection to Office 365 Exchange Online, please run this command. You must run this example before
any other step.
Connect-OSCEXOWebService -Credential (Get-Credential
admin@domain01.onmicrosoft.com)

Note The Connect-OSCEXOWebService function creates a new variable called exService. This variable is in the global scope of the current Windows PowerShell session. This variable is used by other functions in the script.
Example 3: How to change the text signature for current user who established the connection to Office 365.
To change the text signature for current user who established the connection to Office 365, please run this command.
Set-OSCEXOEmailSignature -TextSignature (Get-Content C:\Scripts\051\textsignature.txt | Out-String) -Verbose

Example 4: How to change the html signature for current user who established the connection to Office 365.
To change the html signature for current user who established the connection to Office 365, please run this command.
Set-OSCEXOEmailSignature -HtmlSignature (Get-Content C:\Scripts\051\htmlsignature.htm | Out-String) -Verbose

Note You may need a 3rd party tool or online email signature generators to make an HTML signature. After the signature is generated, please save it as an
.htm file.
Example 5: How to clear the text signature and the html signature for current user who established the connection to Office 365.
To clear the text signature and the html signature for current user who established the connection to Office 365, please run this command.
Set-OSCEXOEmailSignature -TextSignature $null -HtmlSignature $null -Verbose
Technical Resources:
Windows PowerShell Advanced Function
Working with user configuration objects by using the EWS Managed API
Forum Threads:
http://community.office365.com/en-us/forums/148/p/22837/111779.aspx
http://community.office365.com/en-us/forums/161/p/63217/240031.aspx
http://community.office365.com/en-us/forums/160/p/71720/267727.aspx
http://community.office365.com/en-us/forums/175/p/72501/271404.aspx