<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>AutoReply &#8211; Webbanshee</title>
	<atom:link href="https://webbanshee.net/tag/autoreply/feed/" rel="self" type="application/rss+xml" />
	<link>https://webbanshee.net</link>
	<description>Your Exchange Server Blog</description>
	<lastBuildDate>Thu, 28 Apr 2022 06:55:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://webbanshee.net/wp-content/uploads/2017/01/WB_BL_RND-150x150.png</url>
	<title>AutoReply &#8211; Webbanshee</title>
	<link>https://webbanshee.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">122610384</site>	<item>
		<title>Out Of Office Multiline Message through PowerShell</title>
		<link>https://webbanshee.net/out-of-office-multiline-message/</link>
					<comments>https://webbanshee.net/out-of-office-multiline-message/#comments</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Sun, 06 Oct 2019 16:35:38 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[AutoReply]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[OOO AutoReply]]></category>
		<category><![CDATA[Out Of Office]]></category>
		<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3046</guid>

					<description><![CDATA[<p><a class="ex-link" href="https://webbanshee.net/out-of-office-multiline-message"><img src="https://webbanshee.net/wp-content/uploads/2019/10/OOO_Multiline_Message.svg" /><span class="exTeaser">This post lists some options on how to activate an Out Of Office message via PowerShell and how to preserve the layout of the absence message.</span><br />
<span class="exText">To activate an Out Of Office Message using PowerShell is not a complicated task. But it can be time-consuming when you need to do it for a variety of mailboxes that use a different Out Of Office message layout.<span style="font-size: 11px !Important; width: 10%; height: 5%; color: #993333; padding-left: 20px;">......read more</span></span></a></p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/out-of-office-multiline-message/">Out Of Office Multiline Message through PowerShell</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style type="text/css">h2 {font-weight: bold;text-decoration:none;font-size: 20px!Important;}h3 {font-weight: bold;text-decoration:none;font-size: 18px!Important;}.wp-image-2045,.wp-image-2051,.wp-image-2050,.wp-image-2049,.wp-image-2056, .wp-image-2055 {margin-top:2px!Important;margin-right:6px;}.bckgr {background:#ccc;} .see {overflow-x:scroll!Important;overflow-y:hidden;white-space: nowrap;Background:#FDFDF4;border-left: 16px solid #7C98E2; border-top-left-radius:30px; padding-top:15px;padding-left:15px;padding-bottom:10px;scroll-behavior: smooth;}.MsoNormal {background:transparent!Important;} .code-bg {margin-top: -5px;} .RedToPost {position: relative;display: inline-block;cursor: pointer;float: left;background: #D84C56;color: #fff;margin-top:8px;font-weight:bold;} .BlueCopy:hover {opacity: 0.85;}; .RedToPost a {color:#fff;} .RedToPost a:hover {color:#fff;} .RedToPost a:visited {color:#fff;}</style>
<p style="text-align: justify;">We receive requests to activate Out Of Office messages for several mailboxes on a daily base. It is not a complicated task but can be time-consuming when you need to set up Out Of Office messages containing multiple lines, that you adjust within HTML tags, for a variety of mailboxes from several customers. You probably know what I mean: Are the line break tags at the right place? Does the next paragraph begin where it should?</p>
<p style="text-align: justify;">For this reason, I wanted to achieve that we are able just to copy and paste the Out Of Office message from the request, provide the type of the AutoReplyState (enable, disable, schedule) and get visual feedback on the applied attributes, without the need to picture the original customer OOO message in HTML. My script at point 3 of this post will exactly do this.</p>
<p style="text-align: justify;">In the following lines, you can find options on how to activate or disable Out Of Office messages from PowerShell.</p>
<h2><img class="alignnone size-full wp-image-2045" src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 -" />Set up a one-liner absence message using PowerShell:</h2>
<p>If you just want to give a short note of your absence the command below should be sufficient:</p>
<div class="wpe-box wpe-box-note3">
<p><strong>Get-Mailbox -Identity <span style="color: #993333;">MailboxToSetupOOO</span> | Set-MailboxAutoReplyConfiguration -AutoReplyState <span style="color: #993333;">Enabled</span> -InternalMessage <span style="color: #993333;">&#8220;EnterYourInternalMessageHere&#8221;</span> -ExternalMessage <span style="color: #993333;">&#8220;EnterYourExternalMessageHere&#8221;</span></strong></p>
</div>
<p>Change the AutoReplyState according to your needs:</p>
<div class="wpe-box wpe-box-note3">
<p><strong><span style="color: #993333;">Enabled</span> = Activation is valid from the point you hit Enter without a defined End-Time</strong><br />
<strong><span style="color: #993333;">Disabled</span> = Deactivates the Out Of Office message. It does not matter if you have defined an Internal or External Message.</strong><br />
<strong><span style="color: #993333;">Scheduled</span> = Define a Start-Time and End-Time during which Out Of Office messages are sent.</strong></p>
</div>
<p style="text-align: justify;">If you set the AutoReplyState to Scheduled you will need to provide a Start-Time and End-Time. Enter the date-format according to your system settings followed by start and end time:</p>
<div class="wpe-box wpe-box-note3">
<p><strong>Get-Mailbox -Identity <span style="color: #993333;">MailboxToSetupOOO</span> | Set-MailboxAutoReplyConfiguration -AutoReplyState <span style="color: #993333;">Scheduled</span> -InternalMessage <span style="color: #993333;">&#8220;EnterYourInternalMessageHere&#8221;</span> -ExternalMessage <span style="color: #993333;">&#8220;EnterYourExternalMessageHere&#8221;</span> -StartTime <span style="color: #993333;">&#8220;DateAccordingYourSystemDateFormatFollowedBy 00:01:00&#8221;</span> -Endtime <span style="color: #993333;">&#8220;DateAccordingYourSystemDateFormatFollowedBy 23:59:00&#8221;</span></strong></p>
</div>
<h2><img class="alignnone size-full wp-image-2051" src="https://webbanshee.net/wp-content/uploads/2019/01/round_2.svg" alt="2 -" />Set up a multiline absence message using HTML tags in PowerShell:</h2>
<p style="text-align: justify;">To set up a multiline Out Of Office message you will need to use HTML tags to preserve the layout.<br />
For example, you receive a request to activate the following message:</p>
<div class="wpe-box wpe-box-note3">
<p>Dear Sender,</p>
<p>Thank you for your email.</p>
<p>I am currently out of the office with no access to my emails.</p>
<p>Please note that your mail will be read with delay.</p>
<p>Kind Regards</p>
</div>
<h3>One option can be to use &lt;br&gt; tags at the end of each line and place an additional &lt;br&gt; tag for an empty line in your InternalMessage / External Message.</h3>
<div class="wpe-box wpe-box-note3">&#8220;Dear Sender,<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
Thank you for your email.<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
I am currently out of the office with no access to my mails.<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
Please note that your mails will be read with delay.<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span><br />
Kind Regards<span style="color: #993333; font-weight: bold;">&lt;br&gt;</span>&#8220;</div>
<p style="text-align: justify;">This option suits mostly scenarios where the message layout does not change and you only want to edit the content. The &lt;br&gt; tags stay where they are.</p>
<h3>The next possibility is a little bit more convenient. Instead of using &lt;br&gt; tags you could use &lt;pre&gt;&lt;/pre&gt; tags and simply paste the Out Of Office message between them:</h3>
<div class="wpe-box wpe-box-note3">
<p>&#8220;<span style="color: #993333; font-weight: bold;">&lt;pre&gt;</span>Dear Sender,</p>
<p>Thank you for your email.</p>
<p>I am currently out of the office with no access to my emails.</p>
<p>Please note that your mail will be read with delay.</p>
<p>Kind Regards<span style="color: #993333; font-weight: bold;">&lt;/pre&gt;</span>&#8221;</p>
</div>
<p>This is also how the script at point 3 works. It utilizes the &lt;pre&gt;&lt;/pre&gt; tags.<br />
</p>
<h2><img class="alignnone size-full wp-image-2050" src="https://webbanshee.net/wp-content/uploads/2019/01/round_3.svg" alt="3 -" />Script to activate a multiline Out Of Office message:</h2>
<p><strong>Usage:</strong></p>
<div class="wpe-box-download" style="padding-left: 10px;"><strong>&#8211; Enter the email address of the mailbox where you want to activate an Out Of Office message.<br />
&#8211; Paste the Out Of Office message. Please ignore possible color differences after pasting the message.<br />
&#8211; Choose the appropriate AutoReplyState.<br />
&#8211; When the script has finished it gives visual feedback. Verify that the applied values are correct.</strong></div>
<p>&nbsp;</p>
<p style="text-align: justify;">Sorry if the common PowerShell colors are displayed here in a different way. It is no easy task to find a plugin that renders and exactly highlights PowerShell in the Backend. ( no hosting on 3rd party servers )<br />
I thought about rewriting the CSS for this one, but it would be too time-consuming. So if you know a plugin or method to highlight PowerShell code that preserves the PowerShell color scheme I would be grateful to get a hint.</p>
<div style="margin-top: 24px;"></div>
<div id="divClipboard" class="see">
<div class="code-bg">
<span style="color: #008000;">#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
    # Activate OOO Messages<br />
    # Written by WebBanshee<br />
    # Feel free to use<br />
    #&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</span></p>
<p><span style="color: #008000;"># clear screen #</span><br />
    cls</p>
<p><span style="color: #008000;"># set formatlist output to the given value</span><br />
    $FormatEnumerationLimit = $null</p>
<p><span style="color: #008000;"># Mailboxname to set OOO message #</span><br />
    [string] $mbname = Read-Host -prompt &#8216;Enter Mailbox to set OOO&#8217;</p>
<p>        while ($mbname -notlike &#8220;*@*&#8221; -or $mbname -notlike &#8220;*.*&#8221;){</p>
<p>            write-host -ForegroundColor yellow &#8220;Please provide a valid smtp address!&#8221;</p>
<p>            [string] $mbname = Read-Host -prompt &#8216;Enter Mailbox to set OOO&#8217;</p>
<p>             }</p>
<p><span style="color: #008000;"># OOO message #</span><br />
    Write-Host &#8220;&#8221;</p>
<p>    [string] $message = Read-Host -Prompt &#8216;Paste OOO Message here &#8211; Leave blank if you plan to disable&#8217;</p>
<p><span style="color: #008000;"># Place OOO message inside HTML Tags to preserve formatting #</span><br />
    $oootxt = &#8216;&lt;pre&gt;&#8217; + $message + &#8216;&lt;/pre&gt;&#8217;</p>
<p><span style="color: #008000;"># Actions #</span><br />
    Write-Host &#8220;&#8221;</p>
<p>    [string] $mode = Read-Host -Prompt &#8216;(e)nable (d)isable or (s)chedule&#8217; </p>
<p><span style="color: #008000;"># (e)nable #</span><br />
    if ($mode -match &#8220;e&#8221;) {</p>
<p>            get-mailbox -Identity $mbname  | Set-MailboxAutoReplyConfiguration -AutoReplyState Enabled -InternalMessage $oootxt -ExternalMessage $oootxt</p>
<p>    }</p>
<p><span style="color: #008000;"># (d)isable</span><br />
    if ($mode -match &#8220;d&#8221;) {</p>
<p>            get-mailbox -Identity $mbname  | Set-MailboxAutoReplyConfiguration -AutoReplyState Disabled</p>
<p>    }</p>
<p><span style="color: #008000;"># (s)schedule</span><br />
    if ($mode -match &#8220;s&#8221;) {</p>
<p>            [string]$startdate = Read-Host -Prompt &#8216;Enter Start-Date according to your system time. For example: mm/dd/yyyy &#8211; Start-Time will be valid from 00:01&#8217;</p>
<p>            [string]$starttime = &#8220;$startdate 00:01:00&#8221; # You can change the StartTime here</p>
<p>            [string]$enddate = Read-Host -Prompt &#8216;Enter End-Date according to your system time. For example: mm/dd/yyyy &#8211; End-Time will be valid until 23:59&#8217;</p>
<p>            [string]$endtime = &#8220;$enddate 23:59:00&#8221; # You can change the EndTime here</p>
<p>            get-mailbox -Identity $mbname  | Set-MailboxAutoReplyConfiguration -AutoReplyState Scheduled -InternalMessage $oootxt -ExternalMessage $oootxt -StartTime $starttime -EndTime $endtime</p>
<p>    }</p>
<p><span style="color: #008000;"># Display Results</span><br />
    Write-host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;</p>
<p>    Write-host -ForegroundColor green &#8220;The following OOO settings have been applied to mailbox:&#8221; $mbname</p>
<p>    $a = get-mailbox -Identity $mbname | Get-MailboxAutoReplyConfiguration | select AutoReplyState, StartTime , Endtime, InternalMessage, ExternalMessage | fl</p>
<p>    $a</p>
</div>
</div>
<div style="width: 100%; float: right;padding-bottom: 20px;"></div>
<p>Annoyed by waiting for Outlook to start?<br />
Maybe you can sort it out with this one:</p>
<p><a class="wpe-button wpe-button-red" href="https://webbanshee.net/slow-loading-outlook-profile/">Slow loading Outlook profile</a></p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/out-of-office-multiline-message/">Out Of Office Multiline Message through PowerShell</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/out-of-office-multiline-message/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3046</post-id>	</item>
	</channel>
</rss>
