Thomas Stensitzki is a leading technology consultant focusing on the Microsoft messaging and collaboration technologies and the owner of Granikos GmbH & Co. KG.
He is an MVP for Office Apps & Services since 2018.
Thomas is an MCT Regional Lead for Germany and delivers Microsoft Learning training courses for Office 365, Microsoft Teams, and Exchange Server.
He holds Master certifications as Microsoft Certified Solutions Master Messaging and as Microsoft Certified Master for Exchange Server 2010. These certifications make him a subject matter expert for any messaging topic related to Microsoft Exchange, Exchange Online, Microsoft 365, and hybrid configurations.
Follow Thomas: LinkedIn, Twitter
His sessions: https://sessionize.com/thomas-stensitzki
MVP Blog: https://blogs.msmvps.com/thomastechtalk Personal blog: http://justcantgetenough.granikos.eu Personal website: http://www.stensitzki.de Thomas' Tech Talk: youtube.com/ThomasStensitzki
Contact Thomas at thomas@mcsmemail.de
When migrating Html content from a CMS database or other sources you might find the Html as an Html encoded string.
Example:
<p><strong>Some Text</strong></p>
But you want to have the string look like this:
<p><strong>Some Text</strong></p>
The following script is a simple PowerShell script to convert an exisiting file containing the Html encoded text and save the decoded string to a new output file.
param( [string]$InputFile, [string]$OutputFile ) Add-Type -AssemblyName System.Web Write-Output "Fetching $($InputFile)" $fileContent = Get-Content $InputFile Write-Output "Converting" [System.Web.HttpUtility]::HtmlDecode($fileContent) | Out-File -FilePath $OutputFile -Encoding utf8 -Force
.\Convert-ToHtml.ps1 -InputFile '.\InputFile.txt' -OutputFile '.\Output.html'
Enjoy!
You might encounter EventId 106 errors on Exchange 2013/2016 servers.
There are some article available on how to fix this issue on servers having a full installationof Exchange Server 2013/2016.
But you might encounter this error on servers having the Exchange 2013/2016 Management Tools installed only as well. In this case the solutions described will not work as expected.
Running the New-PerfCounters cmdlet requires the Microsoft.Exchange.Management.PowerShell.Setup PowerShell snapin. This PowerShell snapin cannot be loaded on servers having the Exchange Management Tools installed.
Add-PsSnapin : The Windows PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.Setup' is not installed on this computer. At line:1 char:1 + Add-PsSnapin Microsoft.Exchange.Management.PowerShell.Setup + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (Microsoft.Excha...owerShell.Setup:String) [Add-PSSnapin], PSArgumentEx ception + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
The required code library is available on servers having the Exchange Management Tools installed. But the library is not added to the registry by default.
Registry of a server running Exchange Management Tools only:
Registry of a fully installed Exchange Server:
Just export the registry key Microsoft.Exchange.Management.PowerShell.Setup from an Exchange Server, fix Exchange file paths (if required) and import the regiytry file on the server having the Exchange Management Tools installed.
Example registry file:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.Setup] "CustomPSSnapInType"="Microsoft.Exchange.Management.PowerShell.SetupPSSnapIn" "ApplicationBase"="D:\\Program Files\\Microsoft\\Exchange Server\\V15\\bin" "AssemblyName"="Microsoft.Exchange.PowerShell.Configuration, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" "Description"="Setup Tasks for the Exchange Server" "ModuleName"="D:\\Program Files\\Microsoft\\Exchange Server\\V15\\bin\\Microsoft.Exchange.PowerShell.configuration.dll" "PowerShellVersion"="1.0" "Vendor"="Microsoft" "Version"="15.0.0.0"
After adding the registry key, you can successfully fix the performance counter issue.
Add-PsSnapin Microsoft.Exchange.Management.PowerShell.Setup New-PerfCounters -DefinitionFileName "$exinstall\setup\perf\WorkerTaskFrameworkPerfCounters.xml”
In some scenarions the current Exchange cumulative updates (Exchange 2013 CU14, Exchange 2016 CU3) resulted in failed and corrupted search indices.
In Exchange Server 2013 the failed search service resulted in the following event log message:
Watson report about to be sent for process id: 28160, with parameters: E12IIS, c-RTL-AMD64, 15.00.1236.003, M.E.Search.Service, M.E.Data.Directory, M.E.D.D.ScopeSet.GetOrgWideDefaultScopeSet, System.ArgumentNullException, 301, 15.00.1236.000. ErrorReportingEnabled: False
A community post states that there won't be an interim hotfix.
But at least the issue has been found and will be fixed with the next cumulative updates for Exchange Server 2013 and Exchange Server 2016.
This script removes or updates users in legacy public folder ACLs. This reduces the likelihood of legacy public folder migration errors due to corrupted ACLs.
When you perform a migration from legacy public folders to modern public folders, you might see the following error as part of the migration reports.
A corrupted item was encountered: Folder ACL
Corrupted items count towards the bad item limit and will not be migrated.
When you take a closer look at the public folder ACLs, you'll see that there will be orphaned users and even users that have not been properly converted during past legacy replications.
In preparation for a modern public folder migration, you should clean up the public folder ACLs from so-called zombie users.
Tasks performed by the script:
# EXAMPLE 1 # Validate ACLs on public folder \MYPF and all of it's child public folders on Exchange server EX2010 .\Clean-PublicFolderACL.ps1 -RootPublicFolder "\MYPF" -PublicFolderServer EX2010 -ValidateOnly -Recurse # EXAMPLE 2 # Clean ACLs on public folder \MYPF and all of it's child public folders on Exchange server EX200701 .\Clean-PublicFolderACL.ps1 -RootPublicFolder "\MYPF" -PublicFolderServer EX200701 -Recurse
This script removes orphaned mobile device partnerships from Exchange Server 2013+ user mailboxes. Run the script as a scheduled task to maintain your Exchange Server environment properly.
This script utilizes a settings.xml file to configure
Settings.xml (default)
<?xml version="1.0"?> <Settings> <EmailSettings> <SMTPServer>smtp.mcsmemail.de</SMTPServer> <SMTPPort>25</SMTPPort> <MailFrom>postmaster@mcsmemail.de</MailFrom> <MailTo>postmaster@mcsmemail.de</MailTo> </EmailSettings> <OtherSettings> <!-- MobileDeviceLimit defines the overall threshold of mobile devices for a single user to synchronize. Default is 5. --> <MobileDeviceLimit>5</MobileDeviceLimit> <!-- AgedDeviceLimit defines the threshold of allowed aged devices for a single user to be removed. Default is 1. --> <AgedDeviceLimit>1</AgedDeviceLimit> <!-- Time threshold in days to identify old mobile devices, Be default devices not synchronized for 150 days will be removed --> <LastSyncDays>150</LastSyncDays> </OtherSettings> </Settings>
Steps being executed by the script:
# Example 1 # Remove old mobile device partnerships without sending a report email .\Remove-MobileDevicePartnership.ps1 # Example 2 # Remove old mobile device partnerships and send a report email .\Remove-MobileDevicePartnership.ps1 -SendMail # Example 3 # Search for old mobile device partnerships and write results as CSV to disk .\Remove-MobileDevicePartnership.ps1 -ReportOnly # Example 4 # Remove old mobile device partnerships for a single mailbox and send a report email .\Remove-MobileDevicePartnership.ps1 -MailboxFilter USERALIAS -SendMail