Error “A reboot from a previous installation is pending” during Exchange InstallUninstall

Scenario:  When attempting to install/uninstall Exchange, you receive the following error during readiness checks:

“A reboot from a previous installation is pending”

Even after a reboot, it doesn’t clear this error.

Solution:

  1. Clear values out of the PendingFileRenameOperations key located at: HKLMSYSTEMCurrentControlSetControlSessionManagerPendingFileRenameOperations
  2. You may need to clear out the content of this key as well located at: HKLMSystemControlSet001ControlSessionManager

Determine which Windows Management Framework is installed in PowerShell

Scenario: You want to easily detect which Windows Management Framework is installed on your server.

Solution:

Run either in Powershell

host  | Select Version

OR

$PSVersionTable.PSVersion 

 

MSexchangeHMWo restarted server

Scenario:  A Exchange 2013 Server rebooted on its own.  After reading the memory dump file, you see the information below.  We need to determine what caused this and how to prevent a reboot.

ModuleName: wininit.exe

Process_Name: MSexchangeHMWo

Default_Bucket_ID:    WIN8_Driver_Fault_Server

Solution: We know that Exchange’s Health Manager rebooted the server for us automatically, but why?   First we need to figure out which responder did this.  On the server that rebooted, run the following Powershell:

$1 = (Get-WinEvent -LogName Microsoft-Exchange-ManagedAvailability/* | % {[XML]$_.toXml()}).event.userData.eventXml| ?{$_.ActionID -like “*ForceReboot*”}

$1 | Select ActionID,RequesterName

Now that we have the requestername, you can choose to troubleshoot the requester and put in a global monitor override so it does not restart the server anymore.  In our scenario,  ServiceHealthActiveManagerForceReboot was the responder that rebooted our servers so we applied one of the following Global Monitoring Overrides to prevent the reboot.

Add-GlobalMonitoringOverride -Identity ExchangeServiceHealthActiveManagerForceReboot -ItemType Responder -PropertyName Enabled -PropertyValue 0 -ApplyVersion 15.00.1210.003

OR

Add-GlobalMonitoringOverride -Identity ExchangeServiceHealthActiveManagerForceReboot -ItemType Responder -PropertyName Enabled -PropertyValue 0 -duration 60.00:00:00

 

 

 

 

 

 

 

 

 

Troubleshooting Techniques: Verify ActiveSync is operational on a server

Scenario:  You received complaints that ActiveSync isn’t working for some users in your environment.  Your environment consists of large number of servers and you need a quick way of determining which server is not able to process ActiveSync requests.

Troubleshooting Steps:

  1. Check the server component state on each server: Get-exchangeserver EX* | Get-servercomponentstate | Where {($_.Component -eq “ActiveSyncProxy”) -and ($_.state -ne “Active”)}
  2. Test-ActiveSyncConnectivity:$1 = get-credential
    $Servers = Get-clientaccessserver esg* | Where AdminDisplayVersion -like *15*
    $final = @()
    $Servers | %{$final += Test-ActiveSyncConnectivity -AllowUnsecureAccess:$true -ClientAccessServer $_ -MailboxCredential $1 -lightmode}
  3. Check Logs on the server:
    1. Verify EAS connections are being logged in the IIS Logs: C:inetpublogslogfilesw3svc1
    2. Verify the EAS logs are generating activity. EAS logs should be generated every hour:  c:Program FilesMicrosoftExchange ServerV15LoggingHttpProxyEas
  4. Go to the URL and test.  A working server produces  DeviceIdMissingOrInvalid as an error after authentication:  https://<server fqdn>/Microsoft-server-activesync

Script to monitor the state of the ActiveSyncProxy server component and email an alert

Scenario:  You want to monitor the ActiveSyncProxy server component state. If ActiveSyncProxy becomes inactive, you want the script to automatically resolve the issue and to send an alert via email.

Script:

#Collect Servers
$1 = Get-exchangeserver Ex* | Get-servercomponentstate | Where {($_.Component -eq "ActiveSyncProxy") -and ($_.state -ne "Active")}

#Loop Servers for Component State
$1 | Select -ExpandProperty Identity | %{$s = [string]$_;Set-servercomponentstate $s -component ActiveSyncProxy -state Active -Requester HealthAPI}

#Send an Email
If($1 -ne $null){
$1_body = $1 | Out-String
#Email
$body =""
$smtp = "smtp.domain.com"
[string[]]$to = "Steve@Domain.com","Fred@Domain.com"
$from = "EASMonitor@domain.com"
$subject = "ActiveSync Monitor - Activesync is currently not working on a server" 
$body += "<b><Font color=Black>There could be an issue with ActiveSync as the server component state is not active on the following servers: </b></font><br><br>"
$body += "<Font color=red>$1_body </font><br><br><br>"
#Send Email
send-MailMessage -SmtpServer $smtp -To $to -From $from -Subject $subject -Body $body -BodyAsHtml -Priority high
}

 

“Mailbox Size exceeds target quota ” when issuing new-moverequest

Scenario:  When issuing a new move request, you receive the following error:

Mailbox Size <size> exceeds target quota <size>

Solution:  Temporarily lift the ProhibitSendReceive quota size and run the new move request again. You can set the ProhibitSendReceive quota to unlimited OR to a higher value than the current mailbox size.

Get-mailbox <alias> | Select Prohibit*

Set-mailbox <alias> -prohibitsendreceive unlimited.

If the mailbox is 50MB,  you could also run this:

Set-mailbox <alias> -prohibitsendreceive 55MG.

Determine who has a mailbox and remote mailbox via AD Powershell

Scenario:  You have a list of username’s in a .csv file with a column header labeled: name.  You want to quickly determine which usernames have a Mailbox and RemoteMailbox.

Script:

Import-module ActiveDirectory

$Members = Import-csv C:sharecvusers.csv | Select -ExpandProperty Name

$Members = $Members | Sort

$Members_OnPrem = @()
$Members_o365 = @()

$Members  | %{
    "$_"
    $type = Get-ADUser $_ -properties msExchRecipientTypeDetails | Select -ExpandProperty MSexchRecipientTypeDetails
         If ($type -eq "1"){$Members_OnPrem += $_}
         If ($type -eq "2147483648"){$Members_o365 += $_}
}


Performing a Search-Mailbox with complex search criteria

Scenario: Batman is at it again.  He is now under litigation hold for attacking Superman and you want to search in Superman’s mailbox for any message that was received and sent by Batman, or specific terms were in the Subject, Body, or attachments.  You are only interested for messages sent after 1/1/2012.

Script:

Search-Mailbox Superman -SearchDumpster -SearchQuery "(Received:1/1/2012..5/18/2016) AND (To:Batman@DC.com OR From:Batman@DC.com OR CC:Batman@DC.com OR BCC:Batman@DC.com OR 'Batman' OR 'Bruce' OR 'Wayne')" –targetmailbox BobTheLawyer -loglevel full -targetfolder "Search_Batman"

Test-ActiveSyncConnectivity to verify EAS is working properly

Scenario: You want to test whether ActiveSync (EAS) is working properly.  You can use the following script to determine if EAS is failing on any of your Exchange Client Access Servers:

Script:

#Gather Credentials for the Test User into a variable
$1 = get-credential ("DomainEASTestuser")

#Gather Servers into a variable
$Servers = Get-clientaccessserver 

#Define your collection variable
$EAS = @()

#Loop through each server and test
$Servers | %{$EAS += Test-ActiveSyncConnectivity -AllowUnsecureAccess:$true -ClientAccessServer $_ -MailboxCredential $1 -lightmode}