<?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>Powershell &#8211; Webbanshee</title>
	<atom:link href="https://webbanshee.net/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>https://webbanshee.net</link>
	<description>Your Exchange Server Blog</description>
	<lastBuildDate>Thu, 28 Apr 2022 07:43:07 +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>Powershell &#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>StalledDueToSource_DiskLatency Mailbox Export</title>
		<link>https://webbanshee.net/stalledduetosource_disklatency/</link>
					<comments>https://webbanshee.net/stalledduetosource_disklatency/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Sat, 05 Feb 2022 13:29:14 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[MailboxExport]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Throttling]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=4118</guid>

					<description><![CDATA[<style>.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}</style>
<p><a class="ex-link" href="https://webbanshee.net/stalledduetosource_disklatency/"><img style="width:200px; border-radius:8px;" src="https://webbanshee.net/wp-content/uploads/2022/01/StalledDueToSourceDiskLatency_10_saveas_final.svg"/><span class="exTeaser" style="width:70%;">Finish mailbox export requests that are StalledDueToSource_DiskLatency</span><br />
<span class="exText" style="width:70%;" >Yesterday I exported a 30GB Mailbox to our SFTP server. The request always stalled at the end. As a consequence, the export started to loop and the the export .pst was growing much bigger than the initial mailbox size<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/stalledduetosource_disklatency/">StalledDueToSource_DiskLatency Mailbox Export</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style>
.num{margin-top:2px!Important; margin-right:10px;} h2 {font-weight: bold;text-decoration:none;font-size: 20px!Important;} .see {overflow-x: scroll!Important; overflow-y: hidden;white-space:nowrap;} .wpe-box-note3 {color:#333;} .wp-svg-sun-3 {font-size:24px!Important;position:relative;top:5px;left:5px;}
</style>
<p>Hello fellow Exchange Admins, Yesterday I exported a 30GB Mailbox as a .pst file to our SFTP server. At about 90% the MailboxExportRequest stalled with StalledDueToSource_DiskLatency. </p>
<p>No other exports were running from the source server. I even disabled all scheduled tasks that could have an impact on the database where the mailbox is mounted. </p>
<p>However, the export request always switched to: <span style="font-weight:bold;">StalledDueToSource_DiskLatency</span></p>
<p>As a consequence, the export started to loop. It just created a new folder hierarchy and started to export the items again.</p>
<p>Therefore the export .pst was growing much bigger than the initial mailbox size. In other words, this can blow up your storage capacities if you have a large mailbox and leave the export overnight! Not to mention that the export is useless afterward.</p>
<p>In this post, I want to share how I worked around the StalledDueToSource_DiskLatency condition. </p>
<div class="wpe-box wpe-box-alert" style="background: #FBF4939C!Important; font-weight:bold;">
The solution requires that you have a DAG in place.
</div>
<p>Let&#8217;s start at the beginning:</p>
<div class="wpe-box wpe-box-note3" style="color:#232366;font-weight:bold;">
First, I started the Mailbox Export Request using the Priority switch with <span style="color:#993333;font-weight:bold;">Emergency</span>.<br />
So the export request is being prioritized over other jobs.</p>
<div class="wpe-box wpe-box-note see" style="color:#333;font-weight:bold;">
New-MailboxExportRequest -Mailbox <span style="color:#993333;font-weight:bold;">MailboxToExport</span> -Name <span style="color:#993333;font-weight:bold;">IndividualNameOfTheExportRequest</span> -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span> -BadItemLimit <span style="color:#993333;font-weight:bold;">0</span> -LargeItemLimit <span style="color:#993333;font-weight:bold;">0</span> -FilePath <span style="color:#993333;font-weight:bold;">&#8220;\\PathToExportLocation\NameOfExportedMailbox.pst&#8221;</span> -Priority <span style="color:#993333;font-weight:bold;">Emergency</span>
</div>
</div>
<div class="wpe-box wpe-box-note3" style="color:#232366;font-weight:bold;">
Once the export was running I monitored the request. The following CMDlet will show all relevant information:</p>
<div class="wpe-box wpe-box-note see" style="color:#333;font-weight:bold;">
Get-MailboxExportRequest <span style="color:#993333;font-weight:bold;">IndividualNameOfTheExportRequest</span> -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span>| Get-MailboxExportRequestStatistics <span style="color:#993333;font-weight:bold;">-IncludeReport</span> | select Report,MRSServerName,Name,SyncStage,Priority,LastFailure,FailureCode,FailureType,BadItemLimit,BadItemsEncountered,LargeItemLimit,LargeItemsEncountered,OverallDuration,Status,StatusDetail,EstimatedTransferSize,BytesTransferred,EstimatedTransferItemCount,ItemsTransferred,PercentComplete
</div>
</div>
<p>You can find more useful details on monitoring export requests here:</p>
<p><a class="wpe-button wpe-button-blue" href="https://webbanshee.net/export-mailbox-new-mailboxexportrequest/">Monitor Mailbox Exports</a><br />
<br />
The pain started whenever the export reached completion of 100%.<br />
The job was relinquished due to large delays and unfavorable server health on the source server-side.</p>
<p>As can be seen in the image below the export status stayed inProgress.<br />
While SyncStage was CopyingMessages and StatusDetail was StalledDueToSource_DiskLatency:</p>
<div class="wpe-box wpe-box-note3">
<a href="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-01.png"><img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-01.png" alt="StalledDueToSource_Disklatency" width="481" height="259" class="aligncenter size-full wp-image-4207" srcset="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-01.png 481w, https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-01-300x162.png 300w" sizes="(max-width: 481px) 100vw, 481px" /></a>
</div>
<p>Therefore the export job was relinquished: </p>
<div class="wpe-box wpe-box-note3">
<a href="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-02.png"><img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-02.png" alt="Relinquishing Job StalledDueToSource_Disklatency" width="1246" height="77" class="aligncenter size-full wp-image-4204" srcset="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-02.png 1246w, https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-02-300x19.png 300w, https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-02-1024x63.png 1024w, https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-02-768x47.png 768w" sizes="(max-width: 1246px) 100vw, 1246px" /></a>
</div>
<p>Eventually, the export started all over again. StatusDetail: CreatingFolderHerarchy:</p>
<div class="wpe-box wpe-box-note3">
<a href="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-03.png"><img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-03.png" alt="Creating Folder Hierarchy" width="475" height="254" class="aligncenter size-full wp-image-4205" srcset="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-03.png 475w, https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-03-300x160.png 300w" sizes="(max-width: 475px) 100vw, 475px" /></a>
</div>
<p>Then PercentComplete was 10% again:</p>
<div class="wpe-box wpe-box-note3">
<a href="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-04.png"><img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-04.png" alt="Copying Messages" width="480" height="253" class="aligncenter size-full wp-image-4206" srcset="https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-04.png 480w, https://webbanshee.net/wp-content/uploads/2022/04/StalledDueToSourceDiskLatency-04-300x158.png 300w" sizes="(max-width: 480px) 100vw, 480px" /></a>
</div>
<p>As a result, the size of the export PST grew much bigger than the initial mailbox size.</p>
<p>After all, the solution for me was to switch the mailbox database that hosts the mailbox to another copy within the DAG:</p>
<h2>Work around StalledDueToSource_DiskLatency</h2>
<div class="wpe-box wpe-box-note3" style="color:#232366;font-weight:bold;">
<h5>First, check which mailbox database hosts the mailbox you want to export:</h5>
<div class="wpe-box wpe-box-note" style="color:#333;font-weight:bold;">
Get-Mailbox -Identity <span style="color:#993333;font-weight:bold;">MailboxToExport</span> | select <span style="color:#993333;font-weight:bold;">PrimarySmtpAddress, ServerName, Database</span>
</div>
<p><span style="color:#232366;font-weight:bold;">ServerName shows the server where StalledDueToSource_DiskLatency originates from.</span>
</div>
<div class="wpe-box wpe-box-note3" style="color:#232366;font-weight:bold;">
<h5>Next, check to which servers the passive database copies are seeded:</h5>
<div class="wpe-box wpe-box-note" style="color:#333;font-weight:bold;">
Get-MailboxDatabaseCopyStatus -Identity <span style="color:#993333;font-weight:bold;">DatabaseName</span>
</div>
<p><span style="color:#232366;font-weight:bold;">The output lists the active mailbox database ( Status: Mounted ), the passive copies ( Status: Healthy ), and the lagged mailbox database copy. ( Status: Healthy with ReplayQueueLenghth greater than the others )</span>
</div>
<div class="wpe-box wpe-box-note3" style="color:#232366;font-weight:bold;">
<h5>Now switch the active mailbox database with Status: Mounted to one of the passive copies with Status: Healthy:</h5>
<div class="wpe-box wpe-box-error"<span style="color:#993333;font-weight:bold;">Note that you don&#8217;t switch it to the copy where the ReplayQueueLenghth is greater than on the other copies!</span></div>
<div class="wpe-box wpe-box-note see" style="color:#333;font-weight:bold;">
Move-ActiveMailboxDatabase <span style="color:#993333;font-weight:bold;">DatabaseName</span> -ActivateOnServer <span style="color:#993333;font-weight:bold;">OneOfTheServersFromTheOutputBefore</span>
</div>
<p><span style="color:#232366;font-weight:bold;">As has been noted before take care that you don&#8217;t try to activate the mailbox database on the server that hosts the lagged database copy!</span>
</div>
<p>After the database is switched to another server try to export the mailbox with a new export request.<br />
Given that the new server has no performance or disk issues the export should complete in a normal manner.</p>
<p>&nbsp;</p>
<div class="wpe-box wpe-box-alert" style="background: #FBF49361!Important; font-weight:bold;">
<span style="font-weight:bold;">One more thing:</span><br />
After I activated the mailbox database that hosts the mailbox on another server the ServerName did not change when querying the mailbox.</p>
<div class="wpe-box wpe-box-note3" style="color:#232366;font-weight:bold;">
Get-Mailbox -Identity MailboxToExport | select PrimarySmtpAddress, ServerName, Database
</div>
<p><span style="font-weight:bold;">The output of the command above will still show the old server under ServerName. But this is just visual. However, you can find a good explanation for that</span> <a style="color:#993333; font-weight:bold;" href="https://blog.rmilne.ca/2014/12/04/exchange-servername-points-to-wrong-or-decommissioned-server/" rel="noopener" target="_blank">here</a>.
</div>
<p>Have a nice day <span class="wp-svg-sun-3 sun-3"></span></p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/stalledduetosource_disklatency/">StalledDueToSource_DiskLatency Mailbox Export</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/stalledduetosource_disklatency/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4118</post-id>	</item>
		<item>
		<title>Export Mailbox New-MailboxExportRequest</title>
		<link>https://webbanshee.net/export-mailbox-new-mailboxexportrequest/</link>
					<comments>https://webbanshee.net/export-mailbox-new-mailboxexportrequest/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Thu, 06 Jan 2022 14:21:06 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[MailboxExport]]></category>
		<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=4149</guid>

					<description><![CDATA[<style>.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}</style>
<p><a class="ex-link" href="https://webbanshee.net/export-mailbox-new-mailboxexportrequest/"><img style="border-radius:8px;" src="https://webbanshee.net/wp-content/uploads/2022/03/NewMailboxExportRequest.svg"/><span class="exTeaser" style="width:70%;">Export a mailbox and monitor the export request</span><br />
<span class="exText" style="width:70%;" >Find a detailed description of how to export a mailbox with New-MailboxExportRequest and monitor the export request in this post. Get-MailboxExportRequestStatistics are explained as well.<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/export-mailbox-new-mailboxexportrequest/">Export Mailbox New-MailboxExportRequest</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style>
.num{margin-top:2px!Important; margin-right:10px;} h2 {font-weight: bold;text-decoration:none;font-size: 20px!Important;} .see {overflow-x: scroll!Important; overflow-y: hidden;white-space:nowrap;} .wpe-box-note3 {color:#333;}
</style>
<p>Hello folks, Today I would like to share my experience so far on how to export a mailbox with New-MailboxExportRequest. There are a couple of parameters to query to get useful information about the status of an export request.</p>
<p>As long as everything goes smooth you will probably just need the percentage information. But when the New-MailboxExportRequest stalls or stops with an error you will be happy to have some additional parameters to query at your disposal.</p>
<p>So let&#8217;s get to the point straight away:</p>
<h2>Start to export a mailbox with New-MailboxExportRequest:</h2>
<div class="wpe-box wpe-box-note3">
<div class="wpe-box wpe-box-note see" style="color:#232366;font-weight:bold;">
New-MailboxExportRequest -Mailbox <span style="color:#993333;font-weight:bold;">MailboxName</span> -Name <span style="color:#993333;font-weight:bold;">ExportRequestName</span> -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span> -BadItemLimit <span style="color:#993333;font-weight:bold;">0</span> -LargeItemLimit <span style="color:#993333;font-weight:bold;">0</span> -FilePath <span style="color:#993333;font-weight:bold;">&#8220;\\ServerName\ExportLocationFolder\MailboxName.pst&#8221;</span> -Priority <span style="color:#993333;font-weight:bold;">Emergency</span>
</div>
<p><span style="color:#232366;font-weight:bold;">Use the -Priority switch with Emergency to prevent stalling!</span>
</div>
<h4>After you have started the export request check the progress:</h4>
<div class="wpe-box wpe-box-note3">
<div class="wpe-box wpe-box-note see" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest <span style="color:#993333;font-weight:bold;">-Name ExportRequestName</span> -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span> | Get-MailboxExportRequestStatistics <span style="color:#993333;font-weight:bold;">-IncludeReport</span> | select <span style="color:#993333;font-weight:bold;">Report, name,Priority, FailureCode, FailureType,DiagnosticInfo,BadItemLimit,BadItemsEncountered,LargeItemLimit,LargeItemsEncountered, OverallDuration, Status, StatusDetail,EstimatedTransferSize,BytesTransferred, EstimatedTransferItemCount, ItemsTransferred,PercentComplete</span>
</div>
<p><span style="color:#232366;font-weight:bold;">As a result, you will get the values of the selected parameters.</span><br />
<span style="color:#232366;font-weight:bold;">Adjust the selected parameters if the output gets too long or intransparent.</span><br />
<span style="color:#232366;font-weight:bold;">For example remove <span style="color:#993333;font-weight:bold;">-IncludeReport</span></span></p>
<p><span style="color:#232366;font-weight:bold;">You can find a description of the selected parameters below.</span>
</div>
<h4>First, a short info on the <span style="color:#993333;font-weight:bold;">-IncludeReport</span> switch:<span style="color:#993333;font-weight:bold;"></h4>
<div class="wpe-box wpe-box-note3" style="color:#232366;font-weight:bold;">
When this switch is used in accordance with select Report the ouptut looks like this:</p>
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
<a href="https://webbanshee.net/wp-content/uploads/2022/03/IncludeReport.jpg"><img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2022/03/IncludeReport.jpg" alt="New-MailboxExportRequest -IncludeReport" width="1128" height="683" class="aligncenter size-full wp-image-4162" srcset="https://webbanshee.net/wp-content/uploads/2022/03/IncludeReport.jpg 1128w, https://webbanshee.net/wp-content/uploads/2022/03/IncludeReport-300x182.jpg 300w, https://webbanshee.net/wp-content/uploads/2022/03/IncludeReport-1024x620.jpg 1024w, https://webbanshee.net/wp-content/uploads/2022/03/IncludeReport-768x465.jpg 768w" sizes="(max-width: 1128px) 100vw, 1128px" /></a><br />
The output displays the currently processed items. Depending on the mailbox size the output can get much longer. Below the report, the output of other parameters you have selected is displayed.
</div>
</div>

<h4>New-MailboxExportRequest relevant infos that can be selected:</h4>
<div class="wpe-box wpe-box-note3">
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">Report:</span> Displays the whole export request history when used with the <span style="color:#993333;font-weight:bold;">-IncludeReport</span> switch. Skipped items based on bad or large items limits are also displayed.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">Name:</span> The individual name of the mailbox export request.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">Priority:</span>  Possible values are Lower, Low, Normal (This is the default value), High, Higher, Highest, Emergency [Use the highest priority to prevent stalling. I usually use Emergency]</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">FailureCode:</span> Displays the failure code [ not really useful unless you find a list of failure codes for export requests. I couldn&#8217;t find one.]</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">FailureType:</span> Description of the failure that stopped the mailbox export request.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">DiagnosticInfo:</span> This needs to be used with the <span style="color:#993333;font-weight:bold;">-Diagnostic</span> switch when selected to display diagnostic information. Among others, you will be able to see job pickup results and timestamps.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">BadItemLimit:</span> The max. amount of inconsistent items that will be skipped and will not be exported. When this limit is reached the export will fail. A BadItemLimit greater than 50 requires the <span style="color:#993333;font-weight:bold;">-AcceptLargeDataLoss</span> switch.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">BadItemsEncountered:</span> Number of bad items found during the export.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">LargeItemLimit:</span> The max. amount of items in the mailbox that exceeds the allowed message size. The default value is 0. A value higher than 50 requires the <span style="color:#993333;font-weight:bold;">-AcceptLargeDataLoss</span> switch. (not recommended)</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">LargeItemsEcountered:</span> Number of large items found during the export.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">OverallDuration:</span> Duration of the mailbox export. Includes times of stalling as well.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">Status:</span> The current state of the export. Relevant values are inProgress, Queued, Completed, Failed, Suspended.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">StatusDetail:</span> Displays additional information on some states.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">EstimatedTransferSize:</span> Estimates and displays the amount of the exported data.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">BytesTransferred:</span> Displays the amount of data that has been really transferred. This usually differs from the EstimatedTransferSize.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">EstimatedTransferItemCount:</span> Estimates and displays the number of items that will be transferred.</span><br />
<span style="display:inline-block;margin-bottom:10px;font-weight:bold;"><span style="color:#993333;font-weight:bold;">ItemsTransferred:</span> Displays the number of items that have been transferred. Can differ from EstimatedTransferItemCount. ( Among others depending on encountered bad or large items and the associated limits )</span><br />
<span style="color:#993333;font-weight:bold;">PercentComplete:</span> The progress of the export request in percent.
</div>
<p><span style="color:#232366;">See the standard reference to Get-MailboxExportRequest by Microsoft</span> <a style="font-weight:bold;color:#232366;" href="https://docs.microsoft.com/en-us/powershell/module/exchange/get-mailboxexportrequest?view=exchange-ps" rel="noopener" target="_blank">here</a>.<br />
<span style="color:#232366;">Find more to Get-MailboxExportRequestStatistics by Microsoft under <a style="font-weight:bold;color:#232366;" href="https://docs.microsoft.com/en-us/powershell/module/exchange/get-mailboxexportrequeststatistics?view=exchange-ps" rel="noopener" target="_blank">this link</a>.</span>
</div>
<h2>Modify parameters of a mailbox export request:</h2>
<p>To modify the parameters of an existing mailbox export request you will need to suspend the request first. This can be useful when you retrospectively want to change the BadItemnLimit or want to raise the priority.</p>
<h4>Suspend the mailbox export request:</h4>
<div class="wpe-box wpe-box-note3">
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -Name <span style="color:#993333;font-weight:bold;">ExportRequestName</span> | Suspend-MailboxExportRequest
</div>
<p><span style="color:#232366; font-weight:bold;">In case you want to suspend all mailbox exports of the same batch:</span></p>
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span> | Suspend-MailboxExportRequest
</div>
</div>
<h4>Now change the parameters [Example: <span style="color:#993333;font-weight:bold;">BadItemLimit</span>]</h4>
<div class="wpe-box wpe-box-note3">
<div class="wpe-box wpe-box-note see" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -Name <span style="color:#993333;font-weight:bold;">ExportRequestName</span> | Set-MailboxExportRequest <span style="color:#993333;font-weight:bold;">-BadItemLimit 25</span>
</div>
<p><span style="color:#232366; font-weight:bold;">In order to change all export requests of the same batch:</span></p>
<div class="wpe-box wpe-box-note see" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span> | Set-MailboxExportRequest <span style="color:#993333;font-weight:bold;">-BadItemLimit 25</span>
</div>
</div>

<h4>Resume the mailbox export request:</h4>
<div class="wpe-box wpe-box-note3">
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -Name <span style="color:#993333;font-weight:bold;">ExportRequestName</span> | Resume-MailboxExportRequest
</div>
<p><span style="color:#232366; font-weight:bold;">In case you want to resume all mailbox exports of the same batch:</span></p>
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span> | Resume-MailboxExportRequest
</div>
</div>
<div class="wpe-box wpe-box-alert" style="background: #F9F6D9!Important;">
<span style="font-weight:bold;color:#993333;">Note:</span><br />
<span style="font-weight:bold;">Modifying the BadItemLimit value makes sense when you have started the export with a low BadItemLimit ( for exmaple 5 ). While monitoring the export you assume that there will be more bad item than you have specified.</span></p>
<p><span style="font-weight:bold;">Another case would be when the export fails because the BadItemLimit threshold has been reached. In that case, you can modify the BadItemLimit after the export failed and resume the export. Suspend is not needed here as it has already failed. To be honest I usually trigger a New-MailboxExportRequest when this happens because I don&#8217;t trust the resume. I am not 100 percent sure that the resume picks up where it stopped and I want to prevent duplicated items. But if you trust the resume process more than me give it a try.</span>
</div>
<h2>Remove-MailboxExportRequest</h2>
<p>Here are two arguments to remove mailbox export requests you don&#8217;t need anymore:</p>
<ul>
<li>To export a mailbox with New-MailboxExportRequest with the same request name.</li>
<li>Further, do some housekeeping and keep your environment clean and transparent.</li>
</ul>
<div class="wpe-box wpe-box-note3" style="margin-top:25px;">
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -Name <span style="color:#993333;font-weight:bold;">ExportRequestName</span> | Remove-MailboxExportRequest
</div>
<p><span style="color:#232366; font-weight:bold;">In case you want to remove all mailbox exports of the same batch:</span></p>
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest -BatchName <span style="color:#993333;font-weight:bold;">BatchName</span> | Remove-MailboxExportRequest
</div>
<p><span style="color:#232366; font-weight:bold;">In order to remove all mailbox export requests:</span></p>
<div class="wpe-box wpe-box-note" style="color:#232366;font-weight:bold;">
Get-MailboxExportRequest | Remove-MailboxExportRequest
</div>
</div>
<div class="wpe-box wpe-box-alert" style="background: #F9F6D9!Important;">
<span style="font-weight:bold;color:#993333;">Final remark:</span><br />
<span style="font-weight:bold;color:#232366">Get-mailboxExportRequest vs. Get-MailboxExportRequestStatistics:</span><br />
<span style="font-weight:bold;color:#232366">Whenever an export request got stalled and I monitored the request with Get-MailboxExportRequest it showed me InProgress as the current state.</span></p>
<p><span style="font-weight:bold;color:#232366">Only <span style="color:#993333;font-weight:bold;">Get-mailboxExportRequest | Get-MailboxExportRequestStatistics</span> showed me the real status.</span><br />
<span style="font-weight:bold;color:#232366">It seems regarding the state of the export Get-mailboxExportRequest is not as much reliable as Get-MailboxExportRequestStatistics.</span><br />
<span style="font-weight:bold;color:#232366">For this reason I always use Get-MailboxExportRequestStatistics when I export a mailbox with New-MailboxExportRequest.</span>
</div>
<p>Have a nice day!</p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/export-mailbox-new-mailboxexportrequest/">Export Mailbox New-MailboxExportRequest</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/export-mailbox-new-mailboxexportrequest/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4149</post-id>	</item>
		<item>
		<title>ADFS Server Core Token Signing Certificate</title>
		<link>https://webbanshee.net/adfs-server-core-token-signing-certificate/</link>
					<comments>https://webbanshee.net/adfs-server-core-token-signing-certificate/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Wed, 27 Oct 2021 10:38:03 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[ADFS]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[ServerCore]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=4027</guid>

					<description><![CDATA[<style>.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}</style>
<p><a class="ex-link" href="https://webbanshee.net/adfs-server-core-token-signing-certificate/"><img style="border-radius:8px;" src="https://webbanshee.net/wp-content/uploads/2021/10/ADFS-Server-Core.svg"/><span class="exTeaser" style="width:70%;">ADFS Server Core Token Signing Certificate</span><br />
<span class="exText" style="width:70%;" >With ADFS running on Server Core the method of the yearly renewal of the Token Signing Certificate has changed to PowerShell only. I have just finished the renewal of the Token Signing Certificate via Powershell in our test environment. In this post, I will sum up the steps.<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/adfs-server-core-token-signing-certificate/">ADFS Server Core Token Signing Certificate</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style>
.num{margin-top:2px!Important; margin-right:10px;} h2 {font-weight: bold;text-decoration:none;font-size: 20px!Important;} .see {overflow-x: scroll!Important; overflow-y: hidden;white-space:nowrap;} .wpe-box-note3 {color:#333;}
</style>
<p>Hi there, we have upgraded our servers. ADFS servers are running on Windows Server 2019 Core now. Therewith the method of the yearly renewal of the Token Signing Certificate has changed to PowerShell only.</p>
<p>I have just finished the renewal of the Token Signing Certificate via Powershell in our test environment. In this post, I will sum up the steps.</p>
<p>In case you want to renew the Token Signing certificate via GUI on an appropriate server see this post: <a href="https://webbanshee.net/adfs-token-signing-certificate/">Renew ADFS Token Signing Certificate</a></p>
<p>Let&#8217;s start with a short description of relevant ADFS properties: <span style="font-weight:bold;">[Get-ADFSProperties | fl *cert*]</span></p>
<div class="wpe-box wpe-box-alert" style="background: #F9F6D9!Important; text-align:justify;">
<h4><span style="text-decoration: underline; color: #993333;"><strong>CertficateGenerationThreshold :</strong></span></h4>
<p>Has by default a value of 20 ( days ). That means that 20 days before the current primary ADFS Token Signing Certificate expires, a secondary certificate will be generated ( this will be the new cert after the current one expires ). You can check if the secondary certificate has already been created withe the following commands: </p>
<div class="wpe-box wpe-box-note3" style="color:#232366;">
<span style="font-weight:bold;">Get-AdfsCertificate -CertificateType Token-Signing</span><br />
<span style="font-weight:bold;">Get-AdfsCertificate -CertificateType Token-Decrypting</span>
</div>
<p>When the secondary certificate exists the ouput should list minimum two certificates. Focus on the certificate which has the attribute <span style="font-weight:bold;">IsPrimary</span> set to <span style="font-weight:bold;">False</span>. Verify that the <span style="font-weight:bold;">Not Before:</span> date is correct. </p>
<h4><span style="text-decoration: underline; color: #993333;"><strong>AutoCertificateRollover :</strong></span></h4>
<p>The default value of this attribute should be set to $True and should only be changed to $False for the time when the automatically created secondary certificate will be assigned as the primary ADFS certificate. When you manually renew the Token Signing Certificate this should always be set to $False. Otherwise, the secondary certificate will be promoted as the primary certificate automatically. Web logins to application servers will not be possible until the new certificate has not been introduced on the affected application servers.  </p>
<h4><span style="text-decoration: underline; color: #993333;"><strong>CertificatePromotionThreshold :</strong></span></h4>
<p>This attribute is important and should be monitored before the upcoming expiration of the current ADFS Token Signing Certificate. It defines after how many days ( counting from the creation date of the secondary ADFS certificate ) the new certificate will be defined automatically as primary.<br />
If the value of this attribute is set to 15 it means that the secondary certificate will be assigned as primary automatically after 15 days.<br />
Based on the example above the servers should be updated with the thumbprint of the new certificate maximum of 15 days ( better earlier ) after the creation of the secondary ADFS Token Signing Certificate.</p>
<h4><span style="text-decoration: underline; color: #993333;"><strong>CertificateRolloverInterval :</strong></span></h4>
<p>Defines the interval in minutes at which ADFS checks if a new certificate needs to be generated. The default value is 720. If you change the values above accordingly to their meaning and your needs you can lower this value to 5 minutes for instance to generate the secondary certificate if it has not been generated yet. Set it back to default afterward.</p>
<p>Microsoft describes these properties <a href="https://social.technet.microsoft.com/wiki/contents/articles/16156.ad-fs-2-0-understanding-autocertificaterollover-threshold-properties.aspx" rel="noopener noreferrer" target="_blank">here</a>.
</div>
<p><br />
With that being said we are good to go. Log on to your ADFS Server Core.</p>
<h2><img src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 - ADFS Server Core" class="num"  role="img" />Query the secondary Token Signing and Decrypting certificates</h2>
<div class="wpe-box wpe-box-note3" Style="font-weight:bold;margin-bottom: 10px;">
Get-AdfsCertificate -CertificateType Token-Signing | where {$_.IsPrimary -eq $False}<br />
Get-AdfsCertificate -CertificateType Token-Decrypting   | where {$_.IsPrimary -eq $False}
</div>
<p>Note the thumbprints. You will need them later.</p>
<h2><img src="https://webbanshee.net/wp-content/uploads/2019/01/round_2.svg" alt="2 -" class="num"  role="img" />Export the secondary Token Signing Certificate</h2>
<p>Export the certificate to a location you can reach from the application servers. I usually export the cert to a local folder on the ADFS server.</p>
<div class="wpe-box wpe-box-note3 see" Style="font-weight:bold;margin-bottom: 20px;">
$certRefs=Get-AdfsCertificate -CertificateType Token-Signing | where {$_.IsPrimary -eq <span style="font-weight:bold; color:#993333;">$False</span>}<br />
$certBytes=$certRefs[0].Certificate.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert)<br />
[System.IO.File]::WriteAllBytes(<span style="font-weight:bold; color:#993333;">&#8220;C:\PathToExportFolder\CertName.cer&#8221;</span>, $certBytes)
</div>
<h2><img src="https://webbanshee.net/wp-content/uploads/2019/01/round_3.svg" alt="3 -" class="num"  role="img" />Import the certificate from your ADFS Server Core to all Exchange servers</h2>
<p>The certificate will be imported to the Trusted Root Certification Authority of LocalMachine:</p>
<div class="wpe-box wpe-box-note3 see" Style="font-weight:bold;margin-bottom: 10px;">
Import-Certificate -FilePath <span style="font-weight:bold; color:#993333;">\\ADFSServerName\c`$\PathToExportFolderOnADFSServer\CertName.cer</span> -CertStoreLocation Cert:\LocalMachine\Root
</div>
<p>You can check that the certificate has been imported successfully via remote MMC from a GUI server:</p>
<div class="wpe-box wpe-box-note3">
<span style="color:#232366;font-weight:bold;">MMC > Add/Remove Snap-in > Certificates > Computername > This snap-in will manage: Another Computer > Enter the <span style="color:#993333;font-weight:bold;">ServerName</span> where you just have imported the certificate.</span></p>
<p><span style="color:#232366;font-weight:bold;">Navigate to <span style="color:#993333;font-weight:bold;">ServerName</span>\Trusted Root Certification Authorities > Certificates and verify that the imported ADFS Signing certificate is there.</span>
</div>
<p>Of course you can check it with PowerShell as well:</p>
<div class="wpe-box wpe-box-note3" style="font-weight:bold;">
Set-Location -Path cert:\LocalMachine\root<br />
Get-ChildItem | where {$_.subject -like &#8220;*ADFS*&#8221;} | fl
</div>
<h2><img src="https://webbanshee.net/wp-content/uploads/2019/01/round_4.svg" alt="4 -" class="num"  role="img" />Promote the new secondary certificate to primary on ADFS Server Core</h2>
<div class="wpe-box wpe-box-alert" style="background: #F9F6D9!Important;color:#993333;font-weight:bold; text-align:justify;">
After this logins to web services on the involved application servers using ADFS will not be possible until the new certificate has been introduced on the application servers! ( E.g. Exchange OWA )
</div>
<p>Set AutoCertificationRollover to False to be able to promote your secondary certificate to primary:</p>
<div class="wpe-box wpe-box-note3" style="font-weight:bold;">
Set-ADFSProperties -AutoCertificateRollover <span style="color:#993333;font-weight:bold;">$False</span>
</div>
<p>Query the thumbprint of the new Token Signing and Decrypting certificates:</p>
<div class="wpe-box wpe-box-note3" style="font-weight:bold;">
Get-AdfsCertificate -CertificateType Token-Signing | where {$_.IsPrimary -eq $False}<br />
Get-AdfsCertificate -CertificateType Token-Decrypting   | where {$_.IsPrimary -eq $False}
</div>
<p>Note the thumbprint of both certificates.</p>
<p>Promote both secondary certificates ( Token Signing and Decrypting ) to primary:</p>
<div class="wpe-box wpe-box-note3 see" style="font-weight:bold;">
Set-AdfsCertificate -IsPrimary -CertificateType &#8220;Token-Signing&#8221; -Thumbprint <span style="color:#993333;font-weight:bold;">ThumbprintGoesHere</span><br />
Set-AdfsCertificate -IsPrimary -CertificateType &#8220;Token-Decrypting&#8221; -Thumbprint <span style="color:#993333;font-weight:bold;">ThumbprintGoesHere</span>
</div>
<div class="wpe-box wpe-box-alert" style="background: #F9F6D9!Important;text-align:justify;">
<span style="color:#993333;font-weight:bold;">However, I got an error here stating that I need to add the certificate first. When I tried to add the Token Signing certificate on ADFS Server Core:</span></p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 10px;">
<span style="color:#181818;font-weight:bold;">Add-AdfsCertificate -CertificateType Token-Signing | where {$_.IsPrimary -eq $False}</span>
</div>
<p><span style="color:#993333;font-weight:bold;">The output was a message stating the certificate is already added.</span></p>
<p><span style="color:#993333;font-weight:bold;">I think you need to wait a little bit after you set AutoCertificateRollover to True. Several tries later it succeeded. To be honest I could not identify the cause &#8211; I just assume it could have been the elapsed time after I set AutoCertificateRollover to True.</span>
</div>
<p>Verify that the new certificates have the primary status:</p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 10px;">
<span style="font-weight:bold;">Get-AdfsCertificate -CertificateType Token-Signing | where {$_.IsPrimary -eq <span style="color:#993333;font-weight:bold;">$True</span>}</span><br />
<span style="font-weight:bold;">Get-AdfsCertificate -CertificateType Token-Decrypting   | where {$_.IsPrimary -eq <span style="color:#993333;font-weight:bold;">$True</span>}</span>
</div>
<p>Switch AutoCertificateRollover back to True:</p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 10px;">
<span style="font-weight:bold;">Set-ADFSProperties -AutoCertificateRollover</span> <span style="color:#993333;font-weight:bold;">$True</span>
</div>
<p>Check it:</p>
<div class="wpe-box wpe-box-note3">
<span style="font-weight:bold;">Get-ADFSProperties | fl *cert*</span></p>
<p>AutoCertificateRollover should be True!
</p></div>
<h2><img src="https://webbanshee.net/wp-content/uploads/2019/01/round_5.svg" alt="5 -" class="num"  role="img" />Introduce the new Token Signing Certificate to the Exchange organization</h2>
<p>It is enough to fire the following command once from an Exchange Server within your organization:</p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 15px;">
<span style="font-weight:bold;">Set-OrganizationConfig -AdfsSignCertificateThumbprint</span> <span style="font-weight:bold;color:#993333;">ADFSTokenSigningCertThumbprint</span>
</div>
<p>Verify the AdfsSignCertificateThumbprint:</p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 15px;">
<span style="font-weight:bold;">Get-OrganizationConfig | select adfs*</span>
</div>
<p>Restart IIS:</p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 15px;">
<span style="font-weight:bold;">iisreset /noforce</span>
</div>
<p>Or Restart IIS remotely:</p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 15px;">
<span style="font-weight:bold;">invoke-command -computername <span style="font-weight:bold;color:#993333;">&#8220;ServerName&#8221;</span> -scriptblock {iisreset /noforce}</span>
</div>
<p>Now try to login via web frontend to your application servers. ( try an Outlook on the Web login ) </p>
<p>That&#8217;s it <img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2017/11/Smiley.svg" alt="ADFS Server Core Smiley" width="24" height="24" class="alignnone size-thumbnail wp-image-1478" style="margin-top: 0px; margin-left:8px;" role="img" /></p>
<p>Stay healthy!<br />
&nbsp;</p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/adfs-server-core-token-signing-certificate/">ADFS Server Core Token Signing Certificate</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/adfs-server-core-token-signing-certificate/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4027</post-id>	</item>
		<item>
		<title>Mailbox Audit Logging &#8211; Enable and Search Logs</title>
		<link>https://webbanshee.net/mailbox-audit-logging/</link>
					<comments>https://webbanshee.net/mailbox-audit-logging/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Fri, 12 Mar 2021 07:21:35 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[MailboxAudit]]></category>
		<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3656</guid>

					<description><![CDATA[<style>.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}</style>
<p><a class="ex-link" href="https://webbanshee.net/mailbox-audit-logging/"><img src="https://webbanshee.net/wp-content/uploads/2021/02/MailboxAuditLogging.svg"/><span class="exTeaser" style="width:70%;">Use Mailbox Audit Logging to gather insights about what happens in a certain mailbox. </span><br />
<span class="exText" style="width:70%;" >When a mail went missing without interaction of the mailbox owner Mailbox Audit Logging can provide useful information.<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/mailbox-audit-logging/">Mailbox Audit Logging &#8211; Enable and Search Logs</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style>h2 {font-weight: bold;text-decoration:none;font-size: 22px!Important;}h3 {font-weight: bold;text-decoration:none;font-size: 18px!Important;}h4 {font-weight: bold;text-decoration:none;font-size: 16px!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;}.red{background:#E86275;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;} .wpe-button-blue {background:#1072C1!Important; border: none!Important;} .txtred {color:#993333;font-weight:bold;} .txtbold {font-weight:bold;}</style>
<p style="text-align: justify;">Did you ever receive inquiries about strange mailbox behavior like users state that mails have been deleted without any interaction of the mailbox owner? In cases like this, you are happy to enable Mailbox Audit Logging on the affected mailbox.</p>
<p style="text-align: justify;">This post is about how to enable Mailbox Audit Logging on a certain mailbox and configure the auditing parameters to provide the most relevant insights. Let&#8217;s get to the point straight away:</p>
<p>&nbsp;</p>
<h2><img class="alignnone size-full wp-image-2045" src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 -" />Enable Mailbox Audit Logging on a mailbox</h2>
<h3>Check the audit status on a certain mailbox:</h3>
<div class="wpe-box wpe-box-note3">
<p><span style="font-weight: bold;">get-mailbox -Identity <span style="font-weight: bold; color: #993333;">MailboxName</span> | select PrimarySmtpAddress, *audit* | fl</span></p>
<p>In the following examples, I will use intern@testlab.local as <span style="font-weight: bold;">-Identity</span><br />
The output shows that Mailbox Audit Logging is not enabled on this mailbox:<br />
<a href="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingDisabled.png"><img loading="lazy" class="aligncenter wp-image-3905 size-full" src="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingDisabled.png" alt="Mailbo Audit Logging Disabled" width="1383" height="92" srcset="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingDisabled.png 1383w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingDisabled-300x20.png 300w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingDisabled-1024x68.png 1024w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingDisabled-768x51.png 768w" sizes="(max-width: 1383px) 100vw, 1383px" /></a></p>
</div>
<h3>Enable Mailbox Audit Logging:</h3>
<div class="wpe-box wpe-box-note3">
<p><span style="font-weight: bold;">get-mailbox -Identity <span style="font-weight: bold; color: #993333;">MailboxName</span> | Set-Mailbox -AuditEnabled <span style="font-weight: bold; color: #993333;">$True</span></span></p>
<p>When you check the status again using the first command it will show AuditEnabled as True now.<br />
Operations audited by default are shown as well:<br />
<a href="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingEnabled.png"><img loading="lazy" class="aligncenter size-full wp-image-3910" src="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingEnabled.png" alt="Mailbox Audit Logging Enabled" width="1389" height="93" srcset="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingEnabled.png 1389w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingEnabled-300x20.png 300w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingEnabled-1024x69.png 1024w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLoggingEnabled-768x51.png 768w" sizes="(max-width: 1389px) 100vw, 1389px" /></a></p>
<p>If your output is truncated with ellipses (&#8230;) <a class="wpe-button wpe-button-blue" href="https://webbanshee.net/expand-powershell-output/" target="_blank" rel="noopener noreferrer">change the $FormatEnumerationLimit value.</a></p>
</div>
<h3>Define operations that should be audited:</h3>
<p>Depending on what circumstances make a mailbox audit logging necessary you can change the predefined audit operations to more relevant ones. Find a list of actions logged by mailbox audit logging <a style="font-weight: bold; color: #993333;" href="https://docs.microsoft.com/en-us/exchange/policy-and-compliance/mailbox-audit-logging/mailbox-audit-logging?view=exchserver-2019#mailbox-actions-logged-by-mailbox-audit-logging" target="_blank" rel="noopener noreferrer">here.</a></p>
<p>Usually, I completely change the actions for AuditOwner. <strong>AuditOwner = MailboxOwner</strong><br />
To do so use the following command:</p>
<div class="wpe-box wpe-box-note3"><span style="font-weight: bold;">Set-Mailbox <span style="font-weight: bold; color: #993333;">MailboxName</span> -Audit<span style="font-weight: bold; color: #993333;">Owner &#8220;Create, SoftDelete, HardDelete, Update, Move, MoveToDeletedItems,MailboxLogin&#8221;</span></span><br />
<a href="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLogging.png"><img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLogging.png" alt="Mailbox Audit Loggint" width="1320" height="113" class="aligncenter size-full wp-image-3929" srcset="https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLogging.png 1320w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLogging-300x26.png 300w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLogging-1024x88.png 1024w, https://webbanshee.net/wp-content/uploads/2021/03/MailboxAuditLogging-768x66.png 768w" sizes="(max-width: 1320px) 100vw, 1320px" /></a><br />
Adjust the logged actions according to the list by Microsoft mentioned above.<br />
Use <span style="font-weight: bold;">-AuditAdmin</span> or <span style="font-weight: bold;">-AuditDelegate</span> instead of <span style="font-weight: bold;">-AuditOwner</span> to change logged operations for Admin or Delegates.</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 -" />Search Mailbox Audit Logs</h2>
<h3>Define your query:</h3>
<p>The <span style="font-weight: bold;">Search-MailboxAuditLog</span> CMDlet seems only to work out of an Exchange Management Shell. Out of an ISE loaded with an Exchange PS-Snapin, I always get an error. </p>
<p style="text-align: justify;">Undoubtedly the filter for date ranges in connection with the Search-MailboxAuditLog CMDlet is somewhat imprecise. If you want to query a range from 3 days ago until today for instance I recommend setting the end date of the query to the date of tomorrow. Otherwise, it can happen that no results will be shown for the current day or even the day before.</p>
<div class="wpe-box wpe-box-alert5">
<div class="wpe-box wpe-box-note3" style="overflow-x: auto;">
<span style="font-weight: bold;">Search-MailboxAuditLog -Identity <span style="font-weight: bold; color: #993333;">MailboName</span> -StartDate <span style="font-weight: bold; color: #993333;">&#8220;MM/DD/YYYY&#8221;</span> -EndDate <span style="font-weight: bold; color: #993333;">&#8220;MM/DD/YYYY&#8221;</span> -LogonTypes <span style="font-weight: bold; color: #993333;">Owner</span> -ShowDetails | select <span style="font-weight: bold; color: #993333;">lastaccessed, operation, logontype ,logonuserdisplayname,folderpathname,ClientIPAddress,ClientInfoString,ClientMachineName,ClientProcessName,MailboxOwnerUPN,DelegateUserDisplayName,MailboxResolvedOwnerName,SourceItemSubjectslist</span> | sort <span style="font-weight: bold; color: #993333;">lastaccessed</span> |ft -autosize</span>
</div>
<h3>Some notes to the query above:</h3>
<p><span style="font-weight: bold; color:#993333;">-StartDate/-EndDate:</span> The date format can vary depending on the regional settings of your system!<br />
<span style="font-weight: bold; color:#993333;">-LogonTypes:</span> Narrow down your query to logon types you are interested in.</p>
<h3>Selectors:</h3>
<p><span style="font-weight: bold; color:#993333;">Operation:</span> Displays the logged action.<br />
<span style="font-weight: bold; color:#993333;">ClientIpAddress:</span> Shows the IP address of the client respectively the source network outgoing IP address.<br />
<span style="font-weight: bold; color:#993333;">ClientInfoString:</span> Shows client connection types like RPC, ActiveSync, OWA<br />
<span style="font-weight: bold; color:#993333;">ClientProcessName:</span> For example OUTLOOK.exe<br />
<span style="font-weight: bold; color:#993333;">SourceItemSubjectslist:</span> The subject of mails where an action has been logged with.</p>
<p><span style="font-weight: bold;">I recommend to use only relevant selectors when searching an audit log.<br />
Displaying all selectors can make the output confusing or will not fit in at all.</span>
</div>
<p>Stay safe folks!<br />
&nbsp;</p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/mailbox-audit-logging/">Mailbox Audit Logging &#8211; Enable and Search Logs</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/mailbox-audit-logging/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3656</post-id>	</item>
		<item>
		<title>Add Secondary IP Address Windows Server</title>
		<link>https://webbanshee.net/add-ip-address-windows-server/</link>
					<comments>https://webbanshee.net/add-ip-address-windows-server/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Mon, 07 Dec 2020 11:22:19 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[IP-Address]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[ServerCore]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3809</guid>

					<description><![CDATA[<style>.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}</style>
<p><a class="ex-link" href="https://webbanshee.net/add-ip-address-windows-server/"><img src="https://webbanshee.net/wp-content/uploads/2020/12/Add_Remove_IPaddress.svg"/><span class="exTeaser" style="width:70%;">Add or remove an IP address with PowerShell. Includes a script at the end of the post. Fell free to use.</span><br />
<span class="exText" style="width:70%;" >If you want to add a secondary IP Address without using the Change Adapter Options in the GUI ( especially on Windows Core servers ) you can achieve this in a simple way via PowerShell.<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/add-ip-address-windows-server/">Add Secondary IP Address Windows Server</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style>.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 {font-weight:bold; margin-top: -5px;} .BlueCopy:hover {opacity: 0.85;} h2 {font-weight: bold;text-decoration:none;font-size: 20px!Important;}h3 {font-weight: bold;text-decoration:none;font-size: 18px!Important;}h4 {font-weight: bold;text-decoration:none;font-size: 16px!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;} .wpe-button-blue {background: #1072C1!Important; border: none!Important;}.blue{background:#6666cc;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}</style>
<p style="text-align: justify;">If you want to add a secondary IP Address without using the Change Adapter Options in the GUI ( especially on Windows Core servers ) you could use <span class="blue">sconfig</span> or simply add the IP address with PowerShell.</p>
<p style="text-align: justify;">In my case, I wanted to add a secondary IP address to a certain interface on some Windows Server Core servers. Unfortunately, an Invalid Index error was thrown when I chose the appropriate interface under sconfig &#8211; Network Settings:</p>
<div class="wpe-box wpe-box-note3" style="margin-top: 50px;"><a href="https://webbanshee.net/wp-content/uploads/2020/12/Invalid_Index.png"><img loading="lazy" class="aligncenter size-full wp-image-3817" src="https://webbanshee.net/wp-content/uploads/2020/12/Invalid_Index.png" alt="Invalid Index Network Settings" width="623" height="130" srcset="https://webbanshee.net/wp-content/uploads/2020/12/Invalid_Index.png 623w, https://webbanshee.net/wp-content/uploads/2020/12/Invalid_Index-300x63.png 300w" sizes="(max-width: 623px) 100vw, 623px" /></a></div>
<p style="text-align: justify;">However, I faced this error a couple of months ago already when I wanted to <a class="wpe-button wpe-button-blue" href="https://webbanshee.net/disable-ipv6-on-server-core/" rel="noopener noreferrer">Disable IPv6</a> in my test lab.</p>
<p style="text-align: justify;">Because this time it was production servers I didn&#8217;t want to change any settings while adding secondary IP addresses to the servers. The only option was to add a secondary IP address via PowerShell.</p>
<p>&#8230; and here we go:</p>
<h2>Add Secondary IP Address to Network Interface:</h2>
<h3><img class="alignnone size-full wp-image-2045" src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 -" />List Network Interfaces with name and Interface Index</h3>
<div class="wpe-box wpe-box-note3">
<p><strong>Get-NetAdapter</strong></p>
<p><a href="https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter.png"><img loading="lazy" class="aligncenter size-full wp-image-3820" src="https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter.png" alt="List Network Interfaces" width="588" height="102" srcset="https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter.png 588w, https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter-300x52.png 300w" sizes="(max-width: 588px) 100vw, 588px" /></a></p>
</div>
<h3><img class="alignnone size-full wp-image-2051" src="https://webbanshee.net/wp-content/uploads/2019/01/round_2.svg" alt="2 -" />Display existent IPs on chosen Network Interface</h3>
<div class="wpe-box wpe-box-note3">To list IPv4 and IPv6 IP addresses:<br />
<span style="font-weight: bold;">Get-NetAdapter -ifIndex</span><span style="font-weight: bold; color: #993333;">  ifIndex Number</span><span style="font-weight: bold;"> | Get-NetIPAddress | select IPAddress | ft</span><a href="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_All.png"><img loading="lazy" class="aligncenter size-full wp-image-3821" src="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_All.png" alt="List IPv4 and IPv6 addresses" width="889" height="90" srcset="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_All.png 889w, https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_All-300x30.png 300w, https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_All-768x78.png 768w" sizes="(max-width: 889px) 100vw, 889px" /></a>To display only IPv4 addresses:<br />
<span style="font-weight: bold;">Get-NetAdapter -ifIndex</span><span style="font-weight: bold; color: #993333;"> ifIndex Number</span><span style="font-weight: bold;"> | Get-NetIPAddress | where {$_.AddressFamily –eq “IPv4”} | select IPAddress</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4.png"><img loading="lazy" class="aligncenter size-full wp-image-3828" src="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4.png" alt="List IPv4 addresses" width="899" height="82" srcset="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4.png 899w, https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4-300x27.png 300w, https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4-768x70.png 768w" sizes="(max-width: 899px) 100vw, 899px" /></a></p>
</div>
<h3><img class="alignnone size-full wp-image-2050" src="https://webbanshee.net/wp-content/uploads/2019/01/round_3.svg" alt="3 -" />Add new IP address</h3>
<div class="wpe-box wpe-box-note3"><span style="font-weight: bold;">New-NetIPAddress –IPAddress </span><span style="font-weight: bold; color: #993333;">&#8220;IpAddress goes here&#8221;</span><span style="font-weight: bold;"> –PrefixLength 24 –InterfaceIndex</span><span style="font-weight: bold; color: #993333;"> ifIndex Number</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/12/Add_New_IP_Address.png"><img loading="lazy" class="aligncenter size-full wp-image-3819" src="https://webbanshee.net/wp-content/uploads/2020/12/Add_New_IP_Address.png" alt="Add secondary IP address" width="727" height="402" srcset="https://webbanshee.net/wp-content/uploads/2020/12/Add_New_IP_Address.png 727w, https://webbanshee.net/wp-content/uploads/2020/12/Add_New_IP_Address-300x166.png 300w" sizes="(max-width: 727px) 100vw, 727px" /></a><br />
<span style="margin-top: -10px;">The command adds the IP address to the ActiveStore and the Persistent Store.</span><br />
You can read more about the PolicyStore values <a href="https://docs.microsoft.com/en-us/powershell/module/nettcpip/new-netipaddress?view=win10-ps#:~:text=-PolicyStore">here</a>.</div>
<h3><img class="alignnone size-full wp-image-2050" src="https://webbanshee.net/wp-content/uploads/2019/01/round_4.svg" alt="4 -" />Verify that add a secondary IP address was successful</h3>
<div class="wpe-box wpe-box-note3"><span style="font-weight: bold;">Get-NetAdapter -ifIndex</span><span style="font-weight: bold; color: #993333;"> ifIndex Number</span><span style="font-weight: bold;"> | Get-NetIPAddress | where {$_.AddressFamily –eq “IPv4”} | select IPAddress</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/12/IPv4_Address_added.png"><img loading="lazy" class="aligncenter size-full wp-image-3818" src="https://webbanshee.net/wp-content/uploads/2020/12/IPv4_Address_added.png" alt="Add Secondary IP Address done!" width="898" height="93" srcset="https://webbanshee.net/wp-content/uploads/2020/12/IPv4_Address_added.png 898w, https://webbanshee.net/wp-content/uploads/2020/12/IPv4_Address_added-300x31.png 300w, https://webbanshee.net/wp-content/uploads/2020/12/IPv4_Address_added-768x80.png 768w" sizes="(max-width: 898px) 100vw, 898px" /></a></div>
<p>Thats all. You don&#8217;t need to specify a default Gateway since this has most likely be done already with the initial IP address.</p>
<h2>Remove IP Address from Network Interface:</h2>
<h3><img class="alignnone size-full wp-image-2045" src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 -" />List Network Interfaces with name and Interface Index</h3>
<div class="wpe-box wpe-box-note3">
<p><strong>Get-NetAdapter</strong></p>
<p><a href="https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter.png"><img loading="lazy" class="aligncenter size-full wp-image-3820" src="https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter.png" alt="Add Secondary IP Address list" width="588" height="102" srcset="https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter.png 588w, https://webbanshee.net/wp-content/uploads/2020/12/Get-NetAdapter-300x52.png 300w" sizes="(max-width: 588px) 100vw, 588px" /></a></p>
</div>
<h3><img class="alignnone size-full wp-image-2051" src="https://webbanshee.net/wp-content/uploads/2019/01/round_2.svg" alt="2 -" />Display existent IP addresses that can be removed on chosen Network Interface</h3>
<div class="wpe-box wpe-box-note3">We focus here only on IPv4 addresses. See point <img class="alignnone size-full wp-image-2051" style="padding-left: 5px!Important;" src="https://webbanshee.net/wp-content/uploads/2019/01/round_2.svg" alt="2 -" /> above to display IPv6 as well.<br />
<span style="font-weight: bold;">Get-NetAdapter -ifIndex</span><span style="font-weight: bold; color: #993333;"> ifIndex Number</span><span style="font-weight: bold;"> | Get-NetIPAddress | where {$_.AddressFamily –eq “IPv4”} | select IPAddress</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/12/IP_address_to_remove.png"><img loading="lazy" class="aligncenter size-full wp-image-3835" src="https://webbanshee.net/wp-content/uploads/2020/12/IP_address_to_remove.png" alt="add secondary IP address remove" width="904" height="90" srcset="https://webbanshee.net/wp-content/uploads/2020/12/IP_address_to_remove.png 904w, https://webbanshee.net/wp-content/uploads/2020/12/IP_address_to_remove-300x30.png 300w, https://webbanshee.net/wp-content/uploads/2020/12/IP_address_to_remove-768x76.png 768w" sizes="(max-width: 904px) 100vw, 904px" /></a><br />
<strong>Copy IP address to remove from the output.</strong></div>
<h3><img class="alignnone size-full wp-image-2050" src="https://webbanshee.net/wp-content/uploads/2019/01/round_3.svg" alt="3 -" />Remove IP address</h3>
<div class="wpe-box wpe-box-note3">Insert copied IP address in the command below:<br />
<span style="font-weight: bold;">Get-NetIPAddress –IPAddress </span><span style="font-weight: bold; color: #993333;">IPAddressToRemove</span><span style="font-weight: bold;"> –InterfaceIndex</span><span style="font-weight: bold; color: #993333;"> ifIndex Number </span><span style="font-weight: bold;">| Remove-NetIPAddress</span>You will need to confirm it for both PolicyStores.<br />
Otherwise you could use the command with <strong>-Confirm:$false</strong></p>
</div>
<h3><img class="alignnone size-full wp-image-2050" src="https://webbanshee.net/wp-content/uploads/2019/01/round_4.svg" alt="4 -" />add secondary IP address verify</h3>
<div class="wpe-box wpe-box-note3"><span style="font-weight: bold;">Get-NetAdapter -ifIndex</span><span style="font-weight: bold; color: #993333;"> ifIndex Number</span><span style="font-weight: bold;"> | Get-NetIPAddress | where {$_.AddressFamily –eq “IPv4”} | select IPAddress</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4.png"><img loading="lazy" class="aligncenter size-full wp-image-3828" src="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4.png" alt="Add secondary IP address IPv4 addresses" width="899" height="82" srcset="https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4.png 899w, https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4-300x27.png 300w, https://webbanshee.net/wp-content/uploads/2020/12/IP_Address_IPv4-768x70.png 768w" sizes="(max-width: 899px) 100vw, 899px" /></a></div>
<p>I have compiled the above steps in a script to make it more convenient:</p>
<p><a class="wpe-button wpe-button-blue" href="https://webbanshee.net/powershell-script-addremove-ip/" rel="noopener noreferrer">Script to Add/Remove IP Address</a></p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/add-ip-address-windows-server/">Add Secondary IP Address Windows Server</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/add-ip-address-windows-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3809</post-id>	</item>
		<item>
		<title>Remote PowerShell Session to Server Core</title>
		<link>https://webbanshee.net/remote-powershell-session/</link>
					<comments>https://webbanshee.net/remote-powershell-session/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Tue, 22 Sep 2020 14:59:13 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[ServerCore]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3619</guid>

					<description><![CDATA[<style>.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;} .txtbold {font-weight:bold;}</style>
<p><a class="ex-link" href="https://webbanshee.net/remote-powershell-session/"><img src="https://webbanshee.net/wp-content/uploads/2020/08/RemotePowerShell_vint.svg" /><span class="exTeaser" style="width: 70%;">Connect via a Remote PowerShell Session to another server.</span><br />
<span class="exText" style="width: 70%;">Use the following commands to establish, enter, or remove a Remote PowerShell Session: <span class="txtbold">New-PSSession, Enter-PSSession, Remove-PSSession </span><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/remote-powershell-session/">Remote PowerShell Session to Server Core</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style>h2 {font-weight: bold;text-decoration:none;font-size: 20px!Important;}h3 {font-weight: bold;text-decoration:none;font-size: 18px!Important;}h4 {font-weight: bold;text-decoration:none;font-size: 16px!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;}.red{background:#E86275;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;} .wpe-button-blue {background:#1072C1!Important; border: none!Important;} .txtred {color:#993333;font-weight:bold;} .txtbold {font-weight:bold;}.entry-title {color: #fefefe;font-size: 30px;font-weight: 400;margin-bottom: 10px;padding-left: 10px;background: #353535;border-top-left-radius: 5px;border-bottom-left-radius: 5px;}</style>
<p style="text-align: justify;">Hello Folks, this is just a simple post on how to open and enter a Remote PowerShell Session from one server to another. A lot of tasks on different servers can be accomplished in a convenient way from one server.</p>
<p style="text-align: justify;">For instance if you want to <a class="wpe-button wpe-button-blue" href="https://webbanshee.net/change-input-language-on-server-core-login-screen/" rel="noopener noreferrer">Change the Keyboard Layout</a> on the login screen of a new Server Core installation.</p>
<p style="text-align: justify;">We will use the cmdlets below to open, enter, exit, and remove a Remote PowerShell session.</p>
<h3 style="margin-top: 30px;">Remote PowerShell Prerequisites:</h3>
<div class="wpe-box wpe-box-download" style="background: #eaf7da!Important;">To receive PowerShell remote commands <strong>PS-Remoting</strong> must be enabled on the computer. PS-Remoting is enabled by default. Further the <strong>WinRM Service</strong> needs to be started.</div>
<p>If you want to go for sure firstly check the PS-Remoting state of the remote computer with:</p>
<div class="wpe-box wpe-box-note3"><span style="font-weight: bold;">Test-WSMan -ComputerName</span><span style="color: #993333; font-weight: bold;"> NameOfRemoteComputer</span></div>
<p>Afterward, verify the state of the WinRM service on the remote computer that it is running:</p>
<div class="wpe-box wpe-box-note3"><span style="font-weight: bold;">Get-Service WinRM -ComputerName</span><span style="color: #993333; font-weight: bold;"> NameOfRemoteComputer</span><span style="font-weight: bold;"> | Select MachineName,Name,Status</span></div>
<h3 style="margin-top: 30px;">Remote PowerShell Session Cmdlets:</h3>
<div class="wpe-box wpe-box-alert" style="background: #F9F6D9!Important;"><strong>Get-PSSession</strong> &#8211; [Shows current sessions]<br />
<strong>New-PSSession</strong> &#8211; [Create a new persistent connection to the target host]<br />
<strong>Enter-PSSession</strong> &#8211; [Enter a session as interactive session]<br />
<strong>Exit-PSSession</strong> &#8211; [Exit session. The session will still be alive in the background]<br />
<strong>Disconnect-PSSession</strong> &#8211; [Disconnect from the session]<br />
<strong>Connect-PSSession</strong> &#8211; [connect to a disconnected session]<br />
<strong>Remove-PSSession</strong> &#8211; [Remove an earlier created persistent session]</div>
<p>Ok, here we go &#8230;</p>
<h2><img class="alignnone size-full wp-image-2045" src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 -" />Create a Remote PowerShell Session with New-PSSession:</h2>
<div class="wpe-box wpe-box-note3">
<p><span class="txtbold">New-PSSession -Name <span class="txtred">NameOfSession</span> -ComputerName</span><span class="txtred"> NameOfRemoteComputer</span><span class="txtbold"> -Credential</span><span class="txtred"> Domain\Username</span>.</p>
<p>In case you don&#8217;t want to give the remote PowerShell session a name it will be named WinRM*</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 -" />Check the newly created session with Get-PSSession:</h2>
<div class="wpe-box wpe-box-note3"><span class="txtbold">Get-PSSession</p>
<p></span>The output will show the state of the session:<br />
<a href="https://webbanshee.net/wp-content/uploads/2020/09/Get-PSSession.png"><img loading="lazy" class="aligncenter size-full wp-image-3639" src="https://webbanshee.net/wp-content/uploads/2020/09/Get-PSSession.png" alt="Get Remote PowerShell Session" width="756" height="71" srcset="https://webbanshee.net/wp-content/uploads/2020/09/Get-PSSession.png 756w, https://webbanshee.net/wp-content/uploads/2020/09/Get-PSSession-300x28.png 300w" sizes="(max-width: 756px) 100vw, 756px" /></a>I gave my session the name &#8220;ServerCore&#8221;. It connects to an Exchange 2019 server running on Server 2019 Core with hostname &#8220;exchange2019&#8221;</p>
<p>If you have more sessions you can go for the computer name:<br />
<span class="txtbold">Get-PSSession -ComputerName</span><span class="txtred"> NameOfRemoteComputer</p>
<p></span>&#8230; or explicit for the session name:<br />
<span class="txtbold">Get-PSSession -Name</span><span class="txtred"> NameOfSession</p>
<p></span>&#8230; and also for the Id:<br />
<span class="txtbold">Get-PSSession -Name</span><span class="txtred"> ID</span></div>
<h2><img class="alignnone size-full wp-image-2050" src="https://webbanshee.net/wp-content/uploads/2019/01/round_3.svg" alt="3 -" />Enter a session directly as an interactive session with Enter-PSSession:</h2>
<div class="wpe-box wpe-box-note3" style="text-align: justify;"><span class="txtbold">Enter-PSSession -ComputerName </span><span class="txtred">NameOfRemoteComputer</span><br />
<span class="txtbold">Enter-PSSession -name</span> <span class="txtred">NameOfSession</span>.<br />
&nbsp;<br />
As a result, PowerShell switches to the entered interactive session:<br />
&nbsp;<br />
<a href="https://webbanshee.net/wp-content/uploads/2020/09/Enter-PSSession.png"><img loading="lazy" class="aligncenter size-full wp-image-3643" src="https://webbanshee.net/wp-content/uploads/2020/09/Enter-PSSession.png" alt="Enter PowerShell Session" width="425" height="41" srcset="https://webbanshee.net/wp-content/uploads/2020/09/Enter-PSSession.png 425w, https://webbanshee.net/wp-content/uploads/2020/09/Enter-PSSession-300x29.png 300w" sizes="(max-width: 425px) 100vw, 425px" /></a><br />
You can perform tasks on the target server via PowerShell from the localhost within this session now.<br />
Enter-PSSession does not require a session that has been created with New-PSSession before.</div>
<p>Find more on how to run Remote Commands from a Remote PowerShell Session <span class="txtbold txtred"><a style="font-weight: bold;" href="https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7" target="_blank" rel="noopener noreferrer">here</a>.</span></p>
<h2><img class="alignnone size-full wp-image-2049" src="https://webbanshee.net/wp-content/uploads/2019/01/round_4.svg" alt="4 -" />Exit an interactive session with Exit-PSSession:</h2>
<div class="wpe-box wpe-box-note3">Within the remote PowerShell type:<br />
<span class="txtbold">Exit-PSSession</p>
<p></span>Instead of Exit-PSSession, you can just type <strong>Exit</strong> as well. It will have the same effect.</p>
<p>Thereafter, the session remains open but you have left the interactive session into the localhost&#8217;s PowerShell:</p>
<p><a href="https://webbanshee.net/wp-content/uploads/2020/09/OpenedPSSession.png"><img loading="lazy" class="aligncenter size-full wp-image-3645" src="https://webbanshee.net/wp-content/uploads/2020/09/OpenedPSSession.png" alt="Open Remote PowerShell Sessions" width="744" height="68" srcset="https://webbanshee.net/wp-content/uploads/2020/09/OpenedPSSession.png 744w, https://webbanshee.net/wp-content/uploads/2020/09/OpenedPSSession-300x27.png 300w" sizes="(max-width: 744px) 100vw, 744px" /></a></div>
<h2><img class="alignnone size-full wp-image-2049" src="https://webbanshee.net/wp-content/uploads/2019/01/round_5.svg" alt="5 -" />Disconnect a session with Disconnect-PSSession:</h2>
<div class="wpe-box wpe-box-note3" style="text-align: justify;">You can disconnect a remote PowerShell session which has been created with New-PSSession.<br />
But you can&#8217;t disconnect an interactive session that has been initiated with Enter-PSSession.</p>
<p>To disconnect a session run the command below from your localhost&#8217;s PowerShell:<br />
<span class="txtbold"><br />
Disconnect-PSSession -name </span><span class="txtred"><span class="txtred">NameOfSession</span></span>&nbsp;</p>
<p>&#8230;or disconnect it based on the ID:<br />
<span class="txtbold">Disconnect-PSSession -Id </span><span class="txtred"><span class="txtred">ID</span></span>&nbsp;</p>
<p>Further, you can disconnect all remote session for a certain remote host based on ComputerName:<br />
<span class="txtbold">Disconnect-PSSession -Id </span><span class="txtred"><span class="txtred">ComputerName</span></span>&nbsp;</p>
<p>Following you get an output like this:<br />
<a href="https://webbanshee.net/wp-content/uploads/2020/09/Disconnect-PSSession.png"><img loading="lazy" class="aligncenter size-full wp-image-3647" src="https://webbanshee.net/wp-content/uploads/2020/09/Disconnect-PSSession.png" alt="Disconnect Remote PowerShell Session" width="756" height="80" srcset="https://webbanshee.net/wp-content/uploads/2020/09/Disconnect-PSSession.png 756w, https://webbanshee.net/wp-content/uploads/2020/09/Disconnect-PSSession-300x32.png 300w" sizes="(max-width: 756px) 100vw, 756px" /></a></p>
<p>You can later reconnect by using the Connect-PSSession cmdlet.</p>
</div>
<h2><img class="alignnone size-full wp-image-2049" src="https://webbanshee.net/wp-content/uploads/2019/01/round_6.svg" alt="6 -" />Reconnect a disconnected PowerShell session:</h2>
<div class="wpe-box wpe-box-note3">As shown below you can reconnect an existing session that has been created with New-PSSession:</p>
<p><span class="txtbold">Connect-PSSession -name </span><span class="txtred">NameOfSession</span>&#8230; or you connect it with its ID:<br />
<span class="txtbold">Connect-PSSession -Id </span><span class="txtred">ID</span>&#8230; as well as with ComputerName:<br />
<span class="txtbold">Connect-PSSession -Id </span><span class="txtred">Computername</span></div>

<h2 class="entry-title" style="font-size: 30px!Important;">Remote PowerShell Session to Exchange Server</h2>
<h2>To connect with a Remote PowerShell Session to Exchange use:</h2>
<div class="wpe-box wpe-box-note3"><span class="txtbold"><span class="txtred">$UserCred</span> = Get-Credential</p>
<p><span class="txtred">$ExSession</span> = New-PSSession -ConfigurationName Microsoft.Exchange –Name <span class="txtred">ExchangeSession</span> -ConnectionUri <span class="txtred">&#8220;http://RemoteExchangeFQDN/powershell&#8221;</span> -Credential <span class="txtred">$UserCred</span> -Authentication Kerberos</p>
<p>Import-PSSession <span class="txtred">$ExSession</span></span></div>
<h3>You can verify the session with name <span class="txtbold"><span class="txtred">ExchangeSession</span></span> you just openend with <span class="txtbold">Get-PSSession</span>:</h3>
<div class="wpe-box wpe-box-note3"><a href="https://webbanshee.net/wp-content/uploads/2020/10/Get-PSSession-Exchange.png"><img loading="lazy" class="aligncenter size-full wp-image-3664" src="https://webbanshee.net/wp-content/uploads/2020/10/Get-PSSession-Exchange.png" alt="Get Remote PowerShell Session Exchange" width="771" height="89" srcset="https://webbanshee.net/wp-content/uploads/2020/10/Get-PSSession-Exchange.png 771w, https://webbanshee.net/wp-content/uploads/2020/10/Get-PSSession-Exchange-300x35.png 300w, https://webbanshee.net/wp-content/uploads/2020/10/Get-PSSession-Exchange-768x89.png 768w" sizes="(max-width: 771px) 100vw, 771px" /></a><br />
<span style="display: block; margin-top: -20px;">The Exchange CMDLets will be available now.</span></div>
<h3>The same can be done from an Exchange Management Shell to connect through a Remote PowerShell session to another Exchange Server:</h3>
<div class="wpe-box wpe-box-note3"><span class="txtbold">Open an Exchange Management Shell</span></p>
<p>If you are on a Server Core type <span class="txtbold">LaunchEMS</span> into the command window.</p>
<p><span class="txtbold">Use the CMDlets from above</span></div>
<p>That&#8217;s all.  <img loading="lazy" class="" src="https://webbanshee.net/wp-content/uploads/2018/10/smiley.png" alt="smiley :)" width="25" height="25" /><br />
&nbsp;<br />
&nbsp;<br />
To display the output of a PowerShell command completely without ellipses take a look here:</p>
<p><a class="wpe-button wpe-button-red" href="https://webbanshee.net/expand-powershell-output/">Expand PowerShell Output</a><br />
&nbsp;</p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/remote-powershell-session/">Remote PowerShell Session to Server Core</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/remote-powershell-session/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3619</post-id>	</item>
		<item>
		<title>Change the Input Language on Server Core</title>
		<link>https://webbanshee.net/change-input-language-on-server-core-login-screen/</link>
					<comments>https://webbanshee.net/change-input-language-on-server-core-login-screen/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Fri, 28 Aug 2020 03:30:30 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[ServerCore]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3553</guid>

					<description><![CDATA[<style>.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}</style>
<p><a class="ex-link" href="https://webbanshee.net/change-input-language-on-server-core-login-screen/"><img src="https://webbanshee.net/wp-content/uploads/2020/08/LanguageSettingsServerCore.svg"/><span class="exTeaser" style="width:70%;">To be able to change the input language on Server Core's Welcome Screen with <span class="key">ALT</span> + <span class="key">SHIFT</span> you first will need to install the the input method of your preferred language.</span><br />
<span class="exText" style="width:70%;" >The Get-WinUserLanguageList cmdlet returns language settings regarding input method, spelling, and text prediction.<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/change-input-language-on-server-core-login-screen/">Change the Input Language on Server Core</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style>h2 {font-weight: bold;text-decoration:none;font-size: 20px!Important;}h3 {font-weight: bold;text-decoration:none;font-size: 18px!Important;}h4 {font-weight: bold;text-decoration:none;font-size: 16px!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;}
.key{background:#444444;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}
.blue{background:#6666cc;padding-left: 5px;padding-right: 5px;padding-top: 2px;padding-bottom: 2px;color:#fefefe;border-radius: 3px;font-size: 14px;}
.space{width: 1px;height: 20px;}
</style>
<p style="text-align: justify;">To be able to change the input language on Server Core&#8217;s Welcome Screen with <span class="key">ALT</span> + <span class="key">SHIFT</span> you first will need to install the the input method of your preferred language.</p>
<p style="text-align: justify;">Open a remote Power Shell session from another server so you can log in with your preferred language layout. You can also log in directly to the server using the server core&#8217;s default language layout.</p>
<p style="text-align: justify;">In case you log in directly type <span class="blue">powershell</span> into the CMD window.</p>
<div class="space"></div>
<h2><img class="alignnone size-full wp-image-2045" src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 -" />Check the WinUserLanguageList for installed languages:</h2>
<div class="wpe-box wpe-box-note3"><strong><span style="color: #993333; font-weight: bold;">$UserLangList</span> = Get-WinUserLanguageList</strong><br />
<strong><span style="color: #993333; font-weight: bold;">$UserLangList</span></strong></div>
<p style="text-align: justify;">The Get-WinUserLanguageList cmdlet returns language settings regarding input method, spelling, and text prediction. Accordingly, this example shows a Server 2019 Core with only the default language installed:</p>
<div class="wpe-box wpe-box-note3"><a href="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageList-Default.png"><img loading="lazy" class="aligncenter size-full wp-image-3589" src="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageList-Default.png" alt="Get-WinUserLanguageList - Default Language" width="327" height="128" /></a></div>
<h2><img class="alignnone size-full wp-image-2051" src="https://webbanshee.net/wp-content/uploads/2019/01/round_2.svg" alt="2 -" />Change the input language by adding your preferred layout to the list:</h2>
<p>You can find a list of language codes here: <a class="wpe-button wpe-button-blue" style="background: #1072C1!Important; border: none!Important;" href="https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a" target="_blank" rel="noopener noreferrer">List of Language Codes</a></p>
<p>Find the relevant Syntax in the <strong>BCP 47 Code</strong> column.</p>
<p>In our example, we will add German as an additional input method.<br />
As a result, one will be able to change the input language to German already at the login screen as well.</p>
<div class="wpe-box wpe-box-note3"><strong><span style="color: #993333; font-weight: bold;">$UserLangList</span>.Add(&#8220;<span style="color: #993333; font-weight: bold;">de-DE</span>&#8220;)</strong><br />
<strong>Set-WinUserLanguageList -LanguageList <span style="color: #993333; font-weight: bold;">$UserLangList</span></strong></div>
<p>Check the WinUserLanguageList again:</p>
<div class="wpe-box wpe-box-note3"><span style="color: #993333; font-weight: bold;">$UserLangList</span><br />
The output will show the additional input language:<br />
<a href="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded.png"><img loading="lazy" class="aligncenter size-full wp-image-3593" src="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded.png" alt="Change the Input Language on Server Core" width="342" height="236" srcset="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded.png 342w, https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded-300x207.png 300w" sizes="(max-width: 342px) 100vw, 342px" /></a></div>
<p>From this point, you will be able to change your keyboard language with <span class="key">ALT</span> + <span class="key">SHIFT</span></p>
<h2 style="margin-top: 40px;"><img class="alignnone size-full wp-image-2050" src="https://webbanshee.net/wp-content/uploads/2019/01/round_3.svg" alt="3 -" />Remove input language from the language list:</h2>
<p>Just in case it is needed you can remove a language as follows &#8230;</p>
<h3>First, you will need the position of the language you want to remove:</h3>
<div class="wpe-box wpe-box-note3"><span style="color: #993333; font-weight: bold;">$UserLangList</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded.png"><img loading="lazy" class="aligncenter size-full wp-image-3593" src="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded.png" alt="Change the input language on server core" width="342" height="236" srcset="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded.png 342w, https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageListAdded-300x207.png 300w" sizes="(max-width: 342px) 100vw, 342px" /></a><br />
<strong>Bear in mind that the first language is position 0 and hence the second language is position 1!</strong></div>
<h3>Remove the language by pointing to the appropriate <span style="color: #993333; font-weight: bold;">[position number]</span>:</h3>
<div class="wpe-box wpe-box-note3"><strong><span style="color: #993333; font-weight: bold;">$UserLangList</span>.Remove(<span style="color: #993333; font-weight: bold;">$UserLangList[1]</span>&#8220;)</strong><br />
<strong>Set-WinUserLanguageList -LanguageList <span style="color: #993333; font-weight: bold;">$UserLangList</span></strong></div>
<h3>Verify that the language has been removed:</h3>
<div class="wpe-box wpe-box-note3"><span style="color: #993333; font-weight: bold;">$UserLangList</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageList-Default.png"><img loading="lazy" class="aligncenter size-full wp-image-3593" src="https://webbanshee.net/wp-content/uploads/2020/08/Get-WinUserLanguageList-Default.png" alt="Change the Input Language on Server Core" width="327" height="128" /></a></div>
<p><strong>The German input method has been removed from the WinUserLanguageList.</strong></p>
<p>Enjoy your day and stay safe.  <i class="wp-svg-smiley smiley"></i><br />
</p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/change-input-language-on-server-core-login-screen/">Change the Input Language on Server Core</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/change-input-language-on-server-core-login-screen/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3553</post-id>	</item>
		<item>
		<title>Entry is missing in the Global Address List</title>
		<link>https://webbanshee.net/entry-missing-in-the-global-address-list/</link>
					<comments>https://webbanshee.net/entry-missing-in-the-global-address-list/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Tue, 28 Apr 2020 10:01:30 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[GAL]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[OWA]]></category>
		<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3520</guid>

					<description><![CDATA[<p><a class="ex-link" href="https://webbanshee.net/entry-missing-in-the-global-address-list/"><img src="https://webbanshee.net/wp-content/uploads/2020/04/FindSomeoneInGAL_ps.svg" /><span class="exTeaser2">After a mailbox or a distribution group has been created it can happen that the appropriate entry is missing in the Global Address List.</span><br />
<span class="exText2">If an entry is missing in the Global Address List you can query the GAL on the server<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/entry-missing-in-the-global-address-list/">Entry is missing in the Global Address List</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">Hello Folks! After a mailbox or a distribution group has been created it can happen that the appropriate entry is missing in the Global Address List.</p>
<p style="text-align: justify;">Assuming the <strong>HiddenFromAddressListsEnabled</strong> attribute is set to<span style="color: #993333;"> <strong>$False</strong></span> on the mailbox or distribution group.</p>
<p style="text-align: justify;">When an entry is missing in the Global Address List it is not necessarily needed but good to know if we can find the object in the GAL on the server.</p>
<h3 style="margin-top: 56px; margin-bottom: 20px;">If an entry is missing in the Global Address List you can query the GAL on the server:</h3>
<div class="wpe-box wpe-box-note3">
<div class="wpe-box wpe-box-note-white" style="background: #ffffff!Important; font-weight: bold;"><span style="color: #209154;">## Add Exchange Server SnapIn to PS ##</span><br />
Add-PSSnapin *exch*</p>
<p><span style="color: #209154;">## Get name of GAL ##</span><br />
<strong>Get-GlobalAddressList</strong></p>
<p><span style="color: #209154;">## Prepare data source ##</span><br />
<strong>$customer = <span style="color: #993333;">&#8220;NameOfGAL &#8211; GAL&#8221;</span></strong><br />
<strong>$members=Get-GlobalAddressList $customer</strong></p>
<p><span style="color: #209154;">## Query for a certain object using a part of its name [ we use -like here ] ##</span><br />
<strong>Get-Recipient -RecipientPreviewFilter $members.RecipientFilter -ResultSize unlimited | where {$_.Name -like <span style="color: #993333;">&#8220;*PartOfObjectName*&#8221;</span>} | fl</strong></p>
</div>
</div>
<p style="text-align: justify;">Independently from the outcome of the above PowerShell commands I usually update the Offline Address Book and the Global Address List afterward.</p>
<p>I have put in the option to query the Global Address List for the missing entry because I usually do it.</p>
<h3>Ok here we go &gt; Update the Offline Address Book:</h3>
<div class="wpe-box wpe-box-note3"><strong>Get-OfflineAddressBook</strong><br />
<strong>Get-OfflineAddressBook -Identity<span style="color: #993333;"> &#8220;NameOfOAB&#8221;</span> | Update-OfflineAddressBook</strong></div>
<h3>Now update the Global Address List:</h3>
<div class="wpe-box wpe-box-note3"><strong>Get-GlobalAddressList</strong><br />
<strong>Get-GlobalAddressList -Identity<span style="color: #993333;"> &#8220;NameOfGAL&#8221;</span> | Update-GlobalAddressList</strong></div>
<p>In most cases, this solves it.<br />
&nbsp;<br />
I usually wait 15 Minutes [ one AD sync cycle ] before notifying the customer.<br />
The user should download the Address Book afterward or restart Outlook.<br />
In OWA new entries should be visible straight away.<br />
&nbsp;</p>
<h3>If the problem persists check the showInAddressBook attribute on the object in AD:</h3>
<div class="wpe-box wpe-box-note3">
<a href="https://webbanshee.net/wp-content/uploads/2020/04/showInAddressBook.png"><img loading="lazy" src="https://webbanshee.net/wp-content/uploads/2020/04/showInAddressBook.png" alt="Entry is missing in the Global Address List" width="801" height="155" class="aligncenter size-full wp-image-3537" srcset="https://webbanshee.net/wp-content/uploads/2020/04/showInAddressBook.png 801w, https://webbanshee.net/wp-content/uploads/2020/04/showInAddressBook-300x58.png 300w, https://webbanshee.net/wp-content/uploads/2020/04/showInAddressBook-768x149.png 768w" sizes="(max-width: 801px) 100vw, 801px" /></a></p>
<p><strong>Compare the values of the attribute showInAddressBook with an account or DL that is available in the Global Address List and add them accordingly if one or more entries are missing.</strong>
</div>
<p><span style="font-weight:bold;font-size:18px;text-align:justify;">If appropriate entries are missing here you wouldn&#8217;t get a result when querying the GAL for the missing entry at the beginning of this post. Further it is likely that HiddenFromAddressListsEnabled is set to <span style="color:#993333;font-weight:bold;">$true.</span></span></p>
<p>When <strong>HiddenFromAddressListsEnabled</strong> is set to <span style="color:#993333; font-weight:bold;">$true</span>:</p>
<div class="wpe-box wpe-box-note3" style="margin-bottom:10px;!Important;">
<strong>> Set it to <span style="color:#993333; font-weight:bold;">$false</span> and reload the attribute in AD.</strong>
</div>
<p>Find some examples at the end of this <a href="https://docs.microsoft.com/en-us/exchange/address-books/address-lists/manage-address-lists" rel="noopener noreferrer" target="_blank">Microsoft description</a>.<br />
&nbsp;<br />
If all entries are visible in <strong>showInAddressBook</strong> you should be fine.<br />
Otherwise add the missing entries under showInAddressBook. </p>
<div class="wpe-box wpe-box-note3">
<strong>> Update OAB and GAL again.</strong>
</div>
<p>&nbsp;<br />
Have a nice day!<br />
&nbsp;<br />
&nbsp;<br />
Want to activate an Out of Office message while retaining the formating?</p>
<p><a class="wpe-button wpe-button-red" href="https://webbanshee.net/out-of-office-multiline-message/">Out Of Office Multiline Message through PowerShell</a></p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/entry-missing-in-the-global-address-list/">Entry is missing in the Global Address List</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/entry-missing-in-the-global-address-list/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3520</post-id>	</item>
		<item>
		<title>CU14 Exchange 2016 and KB4536987</title>
		<link>https://webbanshee.net/cu14-exchange-2016/</link>
					<comments>https://webbanshee.net/cu14-exchange-2016/#comments</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Sat, 15 Feb 2020 09:22:28 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[CU]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Patch]]></category>
		<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3327</guid>

					<description><![CDATA[<p><a class="ex-link" href="https://webbanshee.net/cu14-exchange-2016/"><img src="https://webbanshee.net/wp-content/uploads/2017/10/CUInstallExchange.svg" /><span class="exTeaser">CU14 Exchange 2016 is compatible with .NET versions 4.7.2 and 4.8. It comes with a vulnerability where Microsoft released KB4536987.</span><br />
<span class="exText">See how it went<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/cu14-exchange-2016/">CU14 Exchange 2016 and KB4536987</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;} h5{margin-bottom: 5px;} .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;} .wpe-box-alert {background-color:#f9f6d9!important;border: 1px solid #aaa895;text-align: justify;} .wpe-box-error1 {background-color:#ffebe8!important;border: 1px solid #c00;text-align: justify;} .wpe-box-alert ul li {list-style:square;padding-bottom: 10px;} .wpe-box-note3 ul li {list-style:square; padding-bottom:10px;} .embedly-card-hug {background: #fefefe;}</style>
<div>
<p style="text-align:justify;">We are currently upgrading our Exchange 2016 servers to CU14 Exchange 2016 and started to install CU14 on servers that host only relayed copies.</p>
<p style="text-align:justify;margin-bottom:20px;">CU14 Exchange 2016 is a bridge CU. It is compatible with .NET 4.7.2 and compatible with .NET 4.8 as well. You can upgrade from .Net 4.7.2 to .Net 4.8 after you have CU14 Exchange 2016 in place.</p>
<div class="wpe-box wpe-box-error1">CU14 ( and CU15 ) both come with a vulnerability for which Microsoft released a patch in February.<br />
The patch is classified important and should be installed after CU14 has been installed.</div>
</div>
<p>You can read more about the mentioned vulnerability and download the patch from Microsoft <a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-0688" rel="noopener noreferrer" target="_blank">here</a>.</p>
<h4>Tasks before installing CU14 Exchange 2016:</h4>
<div class="wpe-box wpe-box-alert">
<ul>
<li>
<h5>Backup your web.config files where you have modified parameters or have added new keys.</h5>
<p>As we experienced it still only the web.config file in the OWA directory takes over parameters and keys you have modified before. To be safe I recommend backup every web.config file you have ever touched/modified. So you can easily reapply the changes you have made.
</li>
<li><strong>Disable Check for publisher&#8217;s certificate revocation in IE.</strong></li>
<li><strong>Make sure you have enough free space on the install drive.</strong><br />
I noticed from 2010 and 2013 times a recommendation for at least 10GB of free space.</li>
<li><strong>Take a look at the <a style="font-weight:bold;" href="https://docs.microsoft.com/en-us/exchange/plan-and-deploy/supportability-matrix?view=exchserver-2019" rel="noopener noreferrer" target="_blank">supportability matrix</a> if you plan to upgrade to .NET 4.8</strong></li>
<li><strong>Check Auth methods on service directories like Powershell, OWA, and ECP and note the output.</strong></li>
<li><strong>Switch mailbox databases and put the server in maintenance mode.</strong></li>
</ul>
</div>
<h4>Order of install:</h4>
<div class="wpe-box wpe-box-note3">
<ul>
<li><strong>Install the regular Windows patches ( if necessary )</strong></li>
<li><strong>Install CU14 Exchange 2016</strong></li>
<li><strong>Install patch KB4536987 for Exchange Server 2016 CU14 from an elevated Command Prompt</strong></li>
</ul>
</div>
<p>The CU installation itself took between 2 and 3 hours on the servers in our environment.</p>
<h4>Experiences after CU14 Exchange 2016 has been installed:</h4>
<div class="wpe-box wpe-box-alert">
<ul  style="margin-top: 10px;">
<li>
<div class="wpe-box wpe-box-error1" style="margin-bottom:5px;"><strong>We had mailtips disabled. Mailtips were enabled afterward.</strong></div>
</li>
<li style="margin-bottom: 10px;">To go for sure we checked the Authentication methods on the Virtual Directories again and validated them against the output we made before. All fine.</li>
<li>
<div class="wpe-box wpe-box-note3"><strong>The web.config files in the following directories have been overwritten. Changes needed to be reapplied.</strong></p>
<h5>Active Sync &#8211; [ We have an increased attachment size ] :</h5>
<p>C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\sync<br />
C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\sync</p>
<h5>ECP &#8211; [ We have additional keys in place. ] :</h5>
<p>C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\exchweb\ews</p>
<p>Anyway, I always check the OWA web.config as well:</p>
<h5>OWA &#8211; [ We have additional keys in place ] :</h5>
<p>C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Owa</p></div>
</li>
<li><strong>Virtual directories for additional OWA and ECP needed to be recreated.</strong></li>
</ul>
</div>
<h4>Experiences vulnerability patch KB4536987:</h4>
<div class="wpe-box wpe-box-alert">
After the install and restart it happened on some servers that the content index state on relayed copies was and stayed in status failed.</p>
<p><strong>The following command displayed the cause:</strong></p>
<div class="wpe-box wpe-box-note3" style="margin-bottom: 10px;">
<span style="font-weight:bold;">Get-MailboxDatabaseCopyStatus -Server</span><span style="color:#993333;"> Servername <span style="font-weight:bold;color: #525252"> | fl Identity, ContentIndexErrorMessage</span></div>
<p><strong>Output:</strong></p>
<div class="wpe-box wpe-box-note3">
<strong>ContentIndexErrorMessage:</strong><br />
The Microsoft Exchange Search Host Controller Service is not running on server Servername
</div>
<p>After restarting the Microsoft Exchange Search Host Controller Service the ContentIndexState went back to AutoSuspend.</p>
<p>It took about 45 &#8211; 60 minutes to install the patch. </p>
<p><span style="display: inline-block; width: 80px; height: 30px; background-color: #ee4444; padding: 2px 5px; text-align: center; border-radius: 5px; color: #eee; margin-top: 5px; margin-bottom: 10px;">Update</span><br />
The following subreddit gave me a hint. Thx! No problems appeared on servers where the patch has been installed through an elevated Command Prompt.</p>
<blockquote class="reddit-card" ><p>      <a href="https://www.reddit.com/r/exchangeserver/comments/f2x91q/anyone_installed_kb4536987_yet/?ref_source=embed&amp;ref=share">Anyone installed KB4536987 yet?</a> from      <a href="https://www.reddit.com/r/exchangeserver/">exchangeserver</a>    </p></blockquote>
<p>    <script async src="https://embed.redditmedia.com/widgets/platform.js" charset="UTF-8"></script></p>
<p><strong>Start the patch from an elevated Command Prompt.</strong><br />
&nbsp;<br />
<span style="display: inline-block; width: 80px; height: 30px; background-color: #ee4444; padding: 2px 5px; text-align: center; border-radius: 5px; color: #eee; margin-top: 5px; margin-bottom: 10px;">Update</span><br />
After installing KB4536987 on the last of our servers one of the mailbox database copies switched to failed and suspended and could not be resumed. A reseed failed with:</p>
<div class="wpe-box wpe-box-note3">
<span style="text-align:justify;"><strong>Error: The Microsoft Exchange Replication service encountered an unexpected error in log replay for database &#8216;DBName\ServerName&#8217;. Error MapiExceptionDatabaseError: LogReplayRequest rpc failed.</strong></span>
</div>
<p><span style="display:block;padding-bottom:20px; text-align:justify;">The cause was once again the Microsoft Exchange Search Host Controller Service. We installed KB4536987 through an elevated command prompt. The service was in a running state after the patch has been installed. So we restarted the service. After that, we were able to reseed the copy.</span>
</div>
<p>Good Luck!<br />
&nbsp;<br />
A general description how to install a Cumulative Update on Exchange 2016 can be found here:<br />
&nbsp;<br />
<a class="wpe-button wpe-button-red" href="https://webbanshee.net/cu-install-exchange-2016/">Install CU Exchange 2016</a></p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/cu14-exchange-2016/">CU14 Exchange 2016 and KB4536987</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/cu14-exchange-2016/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3327</post-id>	</item>
		<item>
		<title>Mail Flow Rule Mark External Mail</title>
		<link>https://webbanshee.net/mail-flow-rule-mark-external-mail/</link>
					<comments>https://webbanshee.net/mail-flow-rule-mark-external-mail/#respond</comments>
		
		<dc:creator><![CDATA[WebBanshee]]></dc:creator>
		<pubDate>Wed, 15 Jan 2020 10:45:27 +0000</pubDate>
				<category><![CDATA[Serverside]]></category>
		<category><![CDATA[2013]]></category>
		<category><![CDATA[2016]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[MailFlowRule]]></category>
		<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">https://webbanshee.net/?p=3145</guid>

					<description><![CDATA[<p><a class="ex-link" href="https://webbanshee.net/mail-flow-rule-triggered-action"><img src="https://webbanshee.net/wp-content/uploads/2020/01/NewMailFlowRule.svg" /><span class="exTeaser">To filter mails for certain criteria like sender, recipients, domain, header-information and more it makes sense to create a new Mail Flow Rule and associate it with an action of your choice.</span><br />
<span class="exText">In this example we will create a rule that tags mails from external senders with [EXT]<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/mail-flow-rule-mark-external-mail/">Mail Flow Rule Mark External Mail</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></description>
										<content:encoded><![CDATA[<style type="text/css">/*.entry-content img {border-bottom: 3px solid #F90;}*/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;}</style>
<p style="text-align: justify;">Hello Folks. To filter mails for certain criteria like sender, recipients, domain, header-information and more it makes sense to create a new Mail Flow Rule ( former Transport Rule ) and associate it with an action of your choice.</p>
<p style="text-align: justify;">You could, for example, use a Mail Flow Rule to pretend [EXT] to the subject when a mail comes from an external sender or you could use a rule to classify emails with certain header-information as SPAM and move them to the user&#8217;s Junk-Mail folder.</p>
<p style="text-align: justify;">Ok, let&#8217;s get into it. In this example we will create a rule that tags mails from external senders with [EXT]:</p>
<div class="wpe-box wpe-box-note3"><strong>&gt; Login to your Exchange Control Panel ( ECP ) with an administrative account.</strong><br />
<span style="display: inline-block; text-indent: 12px;"><strong>The URL should be like that:</strong>  <span style="color: #993333; font-weight: bold;">https://YourExchangeURL/ecp<br />
<a style="font-weight: bold;" href="#powershell">&gt; Or click here to create a new Mail Flow Rule via PowerShell</a><br />
</span></span></div>
<h2><img class="alignnone size-full wp-image-2045" src="https://webbanshee.net/wp-content/uploads/2019/01/round_1.svg" alt="1 -" />Create a new Mail Flow Rule via ECP:</h2>
<div class="wpe-box wpe-box-note3"><span style="font-weight: bold;">&gt; In ECP navigate to mail flow &gt; rules and click the <span style="font-size: 26px; position: relative; top: 3px;">+</span> icon. Choose Create a new rule.</span><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/01/NewMailFlowRule.png"><img loading="lazy" class="aligncenter wp-image-3157 size-large" src="https://webbanshee.net/wp-content/uploads/2020/01/NewMailFlowRule-1024x451.png" alt="New Mail Flow Rule" width="1024" height="451" srcset="https://webbanshee.net/wp-content/uploads/2020/01/NewMailFlowRule-1024x451.png 1024w, https://webbanshee.net/wp-content/uploads/2020/01/NewMailFlowRule-300x132.png 300w, https://webbanshee.net/wp-content/uploads/2020/01/NewMailFlowRule-768x338.png 768w, https://webbanshee.net/wp-content/uploads/2020/01/NewMailFlowRule.png 1053w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><br />
The Drop-Down offers several templates for new rules.<br />
We won&#8217;t use them here since we want to create a new Mail Flow Rule from scratch.</div>
<h3>Specify the name and criteria of the new Mail Flow Rule:</h3>
<p>We will create a rule which pretends [EXT] to the message subject when a mail comes from a sender outside of your organization.</p>
<div class="wpe-box wpe-box-note3"><strong>&gt; Specify the name of the rule</strong><br />
<strong>&gt; Click More options</strong><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/01/NameMailFlowRule.png"><img loading="lazy" class="aligncenter size-medium wp-image-3164" src="https://webbanshee.net/wp-content/uploads/2020/01/NameMailFlowRule-300x296.png" alt="Name Mail Flow Rule" width="469" height="463" srcset="https://webbanshee.net/wp-content/uploads/2020/01/NameMailFlowRule-300x296.png 300w, https://webbanshee.net/wp-content/uploads/2020/01/NameMailFlowRule.png 469w" sizes="(max-width: 469px) 100vw, 469px" /></a></p>
<div class="wpe-box wpe-box-alert-orange">
<p><span style="font-weight: bold; font-size: 18px; text-decoration: underline;">For an Exchange environment hosting a single tenant:</span></p>
<p><strong>&gt; Under Apply this rule if choose The sender&#8230; &gt; is external/internal </strong><br />
<strong>&gt; Set it to Outside the organization<br />
&gt; Add another condition<br />
&gt; Choose The recipient&#8230; &gt; domain is<br />
&gt; Add the domain for which you want to mark external mails<br />
&gt; Under Do the following&#8230; choose Prepend the subject of the message with&#8230;<br />
&gt; Enter your preferred tag ( e.g. [EXT] )</strong></p>
<p><a href="https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_so.png"><img loading="lazy" class="aligncenter size-full wp-image-3166" src="https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_so.png" alt="Mail Flow Rule Single Org" width="619" height="343" srcset="https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_so.png 619w, https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_so-300x166.png 300w" sizes="(max-width: 619px) 100vw, 619px" /> </a></p>
<p><strong>&gt; Further down set Match sender address in message to &gt; Envelope</strong><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/01/MatchEnvelope.png"><img loading="lazy" class="aligncenter size-full wp-image-3194" src="https://webbanshee.net/wp-content/uploads/2020/01/MatchEnvelope.png" alt="Mail Flow Rule matches envelope" width="258" height="58" /></a></p>
</div>
<div class="wpe-box wpe-box-alert-orange">
<p><span style="font-weight: bold; font-size: 18px; text-decoration: underline;">For a multi-tenant Exchange environment:</span></p>
<p style="text-align: justify;">Exchange considers a sender to be external if:<br />
• The sender&#8217;s email address isn&#8217;t in an accepted domain.<br />
• The sender&#8217;s email address is in an accepted domain that&#8217;s configured as an external relay domain.</p>
<p style="text-align: justify;">In a multi-tenant environment where tenants send mails between each other, the sender will not be considered as an external sender from the recipient&#8217;s point of view since the sender&#8217;s domain is an accepted domain. This means we cannot use the same conditions as we have used in a single-tenant environment.</p>
<p><strong>&gt; Under Apply this rule if choose The sender&#8230; &gt; address matches any of these text patterns</strong><br />
<strong>&gt; Enter @ as a specified word or phrase<br />
&gt; Add another condition<br />
&gt; Choose The recipient&#8230; &gt; domain is<br />
&gt; Add the domain for which you want to mark external mails<br />
&gt; Under Do the following&#8230; choose Prepend the subject of the message with&#8230;<br />
&gt; Enter your preferred tag ( e.g. [EXT] )<br />
&gt; Under Except if choose The sender &gt; domain is<br />
&gt; Enter one or more domains you don&#8217;t want to be marked as an external sender</strong></p>
<p><a href="https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_multitenant.png"><img loading="lazy" class="aligncenter size-full wp-image-3167" src="https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_multitenant.png" alt="Mail Flow Rule multi-tenant" width="696" height="440" srcset="https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_multitenant.png 696w, https://webbanshee.net/wp-content/uploads/2020/01/MailFlowRuleConditions_multitenant-300x190.png 300w" sizes="(max-width: 696px) 100vw, 696px" /></a><br />
<strong>&gt; Further down set Match sender address in message to &gt; Envelope</strong><br />
<a href="https://webbanshee.net/wp-content/uploads/2020/01/MatchEnvelope.png"><img loading="lazy" class="aligncenter size-full wp-image-3194" src="https://webbanshee.net/wp-content/uploads/2020/01/MatchEnvelope.png" alt="Mail Flow Rule matches envelope" width="258" height="58" /></a></p>
</div>
</div>
<h2 id="powershell"><img class="size-full wp-image-2051 alignnone" role="img" src="https://webbanshee.net/wp-content/uploads/2019/01/round_2.svg" alt="2 -" />Create a new Mail Flow Rule using PowerShell:</h2>
<p><span style="font-weight: bold; font-size: 18px;">For an Exchange environment hosting a single tenant</span></p>
<p>Create a new Mail Flow Rule using the New-TransportRule cmdlet with the following parameters:</p>
<div class="wpe-box wpe-box-white"><strong>New-TransportRule -Name</strong> <span style="color: #993333;">&#8220;Mark mails from external&#8221;</span> <strong>-FromScope</strong> <span style="color: #993333;">NotInOrganization</span> <strong>-RecipientDomainIs</strong> <span style="color: #993333;">testlab.local</span> <strong>-SenderAddressLocation</strong> <span style="color: #993333;">Envelope</span> <strong>-PrependSubject</strong> <span style="color: #993333;">&#8220;[EXT]&#8221;</span> <strong>-Enabled</strong> <span style="color: #993333;">$True</span></div>
<h3>A Short explanation of the used parameters:</h3>
<div class="wpe-box wpe-box-note3"><strong>-Name:</strong><br />
The name of the rule</p>
<p><strong>-FromScope:</strong><br />
Sets the scope to mails from external. This means mails from sender domains that are not in AcceptedDomains of the Exchange organization or are defined as an External Relay Domain.</p>
<p><strong>-RecipientDomainIs:</strong><br />
The recipient domain you want to mark external mails for.</p>
<p><strong>-SenderAddressLocation:</strong><br />
Set to <span style="color: #993333;">Envelope</span> to advise Exchange to fetch the sender&#8217;s address from the mail-header and not from the from field. Since the from field contains the visual address it can be prone to spoofing attempts. To make sure the real sender&#8217;s is address used in the rule use Envelope.</p>
<p><strong>-PrependSubject:</strong><br />
Specify some patterns or words which will be prepended to the subject to tag external mails.</p>
<p><strong>-Enabled:</strong><br />
Activates the rule. If you just want to set up the rule without activating it set the value to <span style="color: #993333;">$False</span></p>
</div>
<p><span style="font-weight: bold; font-size: 18px;">For a multi-tenant Exchange environment</span><br />
Create a new Rule with the parameters below:</p>
<div class="wpe-box wpe-box-white"><strong>New-TransportRule -Name</strong> <span style="color: #993333;">&#8220;Mark mails from external&#8221;</span> <strong>-FromAddressMatchesPatterns</strong> <span style="color: #993333;">&#8220;@&#8221;</span> <strong>-RecipientDomainIs</strong> <span style="color: #993333;">testlab.local</span> <strong>-ExceptIfSenderDomainIs</strong> <span style="color: #993333;">testlab.local</span> <strong>-PrependSubject</strong> <span style="color: #993333;">&#8220;[EXT]&#8221;</span> <strong>-SenderAddressLocation</strong> <span style="color: #993333;">Envelope</span> <strong>-Enabled</strong> <span style="color: #993333;">$True</span></div>
<h3>A Short explanation of the used parameters:</h3>
<div class="wpe-box wpe-box-note3" style="text-align: justify;"><strong>-Name:</strong><br />
The name of the rule.</p>
<p><strong>-FromAddressMatchesPattern:</strong><br />
To catch all mails we give it a common pattern that can be found in all SMTP addresses.</p>
<p><strong>-RecipientDomainIs:</strong><br />
The recipient domain you want to mark external mails for.</p>
<p><strong>-ExcepIfSenderDomainIs:</strong><br />
An exception for your own domain makes sure that your internal mails ( means within the domain you specify here. Not within the Exchange organization! ) will not be marked.</p>
<p><strong>-PrependSubject:</strong><br />
Specify some patterns or words which will be prepended to the subject to tag external mails.</p>
<p><strong>-SenderAddressLocation:</strong><br />
Set to <span style="color: #993333;">Envelope</span> to advise Exchange to fetch the sender&#8217;s address from the mail-header and not from the from field. Since the from field contains the visual address it can be prone to spoofing attempts. To make sure the real sender&#8217;s address is used in the rule use Envelope.</p>
<p><strong>-Enabled:</strong><br />
Activates the rule. If you just want to set up the rule without activating it set the value to <span style="color: #993333;">$False</span></p>
</div>
<h3><img class="alignnone size-full wp-image-2050" role="img" src="https://webbanshee.net/wp-content/uploads/2019/01/round_3.svg" alt="3 -" /> Summary:</h3>
<div class="wpe-box wpe-box-download" style="background: #e7f7d3;">The 1st Mail Flow Rule, which can be used in a single-tenant environment, is triggered when Exchange detects the senders&#8217; domain as a domain that is outside of the Exchange organization.<br />
This means that the senders&#8217; domain is not listed in Accepted Domains or is not configured as an External Relay Domain on the Exchange server.</p>
<p style="text-align: justify;">The 2nd rule, which can be used in a multi-tenant environment ( and also in single-tenant environments ), considers mails from all senders as external emails since the parameter -FromAddressMatchesPattern is filled with the value &#8220;@&#8221; which matches every SMTP address in the envelope.</p>
<p style="text-align: justify;">This is another fact that underlines the importance to set -SenderAddressLocation to Envelope. We have seen visual sender addresses in the FROM field where just a name without @ was displayed. ( only in mails where a malicious sender pretends to be someone out of the recipients&#8217; organization. Spoofing. )</p>
<h3>And here the results:</h3>
<p><a href="https://webbanshee.net/wp-content/uploads/2020/01/ExtMail.png"><img loading="lazy" class="aligncenter size-full wp-image-3208" src="https://webbanshee.net/wp-content/uploads/2020/01/ExtMail.png" alt="Mail Flow Rule External" width="1039" height="273" srcset="https://webbanshee.net/wp-content/uploads/2020/01/ExtMail.png 1039w, https://webbanshee.net/wp-content/uploads/2020/01/ExtMail-300x79.png 300w, https://webbanshee.net/wp-content/uploads/2020/01/ExtMail-768x202.png 768w, https://webbanshee.net/wp-content/uploads/2020/01/ExtMail-1024x269.png 1024w" sizes="(max-width: 1039px) 100vw, 1039px" /></a></p>
<p>With the parameter -ExceptIfSenderDomainIs filled with your recipient domain emails from your domain to your domain ( internal mails ) will not be tagged as external mails.<br />
<a href="https://webbanshee.net/wp-content/uploads/2020/01/IntMail.png"><img loading="lazy" class="aligncenter size-full wp-image-3209" src="https://webbanshee.net/wp-content/uploads/2020/01/IntMail.png" alt="Mail Flow Rule Mark External Mail" width="1042" height="270" srcset="https://webbanshee.net/wp-content/uploads/2020/01/IntMail.png 1042w, https://webbanshee.net/wp-content/uploads/2020/01/IntMail-300x78.png 300w, https://webbanshee.net/wp-content/uploads/2020/01/IntMail-768x199.png 768w, https://webbanshee.net/wp-content/uploads/2020/01/IntMail-1024x265.png 1024w" sizes="(max-width: 1042px) 100vw, 1042px" /></a></p>
</div>
<p>Find a description on the conditions here:  <span style="color: #993333;"><a style="color: #993333;" href="https://docs.microsoft.com/en-us/exchange/policy-and-compliance/mail-flow-rules/conditions-and-exceptions?view=exchserver-2019" target="_blank" rel="noopener noreferrer">Mail flow rule conditions</a></span></p>
<p>Have a nice day!<br />
&nbsp;<br />
</p>
<p>The post <a rel="nofollow" href="https://webbanshee.net/mail-flow-rule-mark-external-mail/">Mail Flow Rule Mark External Mail</a> appeared first on <a rel="nofollow" href="https://webbanshee.net">Webbanshee</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://webbanshee.net/mail-flow-rule-mark-external-mail/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3145</post-id>	</item>
	</channel>
</rss>
