Time to learn some PowerShell. :) It took me far longer to write the comments
than the script.
But it gives me fodder for a blog post. :)
###
### Test-MsExchangeRpc.ps1
###
### Michael B. Smith
### February 14, 2014
### Use as you wish.
### As always, attribution appreciated.
###
### No warranty, express or implied, is offered.
###
### Put this in c:\temp\Test-MsExchangeRpc.ps1
### Also create c:\temp\Test-MsExchangeRpc.bat
### in that file, put:
###
### powershell.exe -NoLogo -NoProfile -NonInteractive -File
C:\Temp\Test-MsExchangeRpc.ps1
###
### Save the file.
###
### Schedule the BAT file with Task Scheduler to start after every reboot.
###
### Or with schtasks.exe:
### schtasks.exe /create /sc onstart /tn Test-ExchangeRpc /tr
c:\Temp\Test-MsExchangeRpc.bat /RU some-user /RP
###
Param(
[string] $service = "MSExchangeRPC",
[int] $delay = 600
)
while( 1 )
{
$rslt = Get-Service $service -EA 0
if( $? )
{
## it's running
}
else
{
Start-Service $service |
Out-Null
}
Sleep $delay
}
From: [email protected] [mailto:[email protected]] On
Behalf Of J- P
Sent: Friday, February 14, 2014 10:16 AM
To: [email protected]
Subject: RE: Again[Exchange] RPC shutdown ex2013- unknown reason
Can someone point me in the direction of setting up a script, or even a paid
utility that will chek for this service and restart it? After 5 months of
perfect exchange 2013 performance this is now the 2nd time in one week RPC
client service has shutdown without any explanation. I'm going to open a PSS
case to find out what is causing it, but in the interim I cant have have
another email disruption.
thanks
From: [email protected]<mailto:[email protected]>
To: [email protected]<mailto:[email protected]>
Subject: RE: [Exchange] RPC shutdown ex2013- unknown reason
Date: Tue, 11 Feb 2014 21:29:40 +0000
You want to restart the entire server instead of writing a few lines of batch?
I sure wouldn't do that. I prefer for all my restarts to be planned and stable.
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of J- P
Sent: Tuesday, February 11, 2014 3:12 PM
To: [email protected]<mailto:[email protected]>
Subject: RE: [Exchange] RPC shutdown ex2013- unknown reason
Thanks again,
question, I see there is an option to "run a program" or "restart the computer"
is there any reason NOT to use the restart the computer, as opposed to writing
something in PS?
thx
________________________________
From: [email protected]<mailto:[email protected]>
To: [email protected]<mailto:[email protected]>
Subject: RE: [Exchange] RPC shutdown ex2013- unknown reason
Date: Tue, 11 Feb 2014 19:47:36 +0000
This is why it stopped trying to restart:
906
The Microsoft Exchange RPC Client Access service failed to start due to the
following error:
The service did not respond to the start or control request in a timely fashion.
In my larger clients we generally run some type of management tool that tracks
essential services and continually tries to restart them if they don't
autorestart. Sounds as if you need something similar. You could whip something
together in powershell probably in less than a dozen lines.
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of J- P
Sent: Tuesday, February 11, 2014 1:50 PM
To: [email protected]<mailto:[email protected]>
Subject: RE: [Exchange] RPC shutdown ex2013- unknown reason
Its almost as if it gave up trying,
These are the service settings currently, should something be different?
Also, wouldn't a clearing of the log generate a "log was cleared" event?
First failure= restart
Second failure= restart
Subsequesnt failure= Restart
reset fail counter after 0 days
restart serice after 0 minutes
tia
J
________________________________
From: [email protected]<mailto:[email protected]>
To: [email protected]<mailto:[email protected]>
Subject: RE: [Exchange] RPC shutdown ex2013- unknown reason
Date: Tue, 11 Feb 2014 18:20:46 +0000
RPC Client Access service crashing is a known issue. Just set it to
automatically restart.
In terms of who cleared your security logs, I can't help you.
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of J- P
Sent: Tuesday, February 11, 2014 12:18 PM
To: [email protected]<mailto:[email protected]>
Subject: [Exchange] RPC shutdown ex2013- unknown reason
I'm beyond stumped here
Walk in no client connectivity, i see rpc client service stopped, turn it on,
all is well.
Here is what got me, the event log shows the following entries
Syslog;
905 pm
The Microsoft Exchange RPC Client Access service terminated unexpectedly. It
has done this 1 time(s). The following corrective action will be taken in 5000
milliseconds: Restart the service
905
The Microsoft Exchange Server Extension for Windows Server Backup service
entered the stopped state
906
A timeout was reached (30000 milliseconds) while waiting for the Microsoft
Exchange RPC Client Access service to connect.
906
The Microsoft Exchange RPC Client Access service failed to start due to the
following error:
The service did not respond to the start or control request in a timely fashion.
App log
First entry 10:32 pm of the same day
An exception occurred and was handled by Exchange ActiveSync. This may have
been caused by an outdated or corrupted Exchange ActiveSync device partnership.
This can occur if a user tries to modify the same item from multiple computers.
If this is the case, Exchange ActiveSync will re-create the partnership with
the device. Items will be updated at the next synchronization.
And there is no record of the Application log being cleared
Any thoughts/suggections/feedback would be appreciated