Solved

Script to restart all automatic services for exchange 3010

Posted on 2013-05-28
3
5,753 Views
Last Modified: 2013-05-29
hi there,
Please do you know if it exits a command line with powershell to restart all automatic services without restart ?
thanks,
Regards
0
Comment
Question by:simlip
3 Comments
 
LVL 4

Assisted Solution

by:baller119
baller119 earned 167 total points
ID: 39202552
There is no single command. But you could use this script.

$ignorePattern = '^(ShellHWDetection|MMCSS|sppsvc|clr_optimization.*)$';
Get-WmiObject Win32_Service 
{ 
  $_.StartMode -eq 'Auto' `
  -and $_.State -ne 'Running' `
  -and $_.Name -notmatch $ignorePattern
}
{ 
  $svcName = $_.Name; 
  Restart-Service -Name $_.Name -EA SilentlyContinue; 
}

Open in new window

0
 
LVL 14

Accepted Solution

by:
Ben Hart earned 167 total points
ID: 39202668
Or this in batch form:
@Echo Off
Echo 'Stopping Microsoft Exchange Services'
net stop MSExchangeAB
net stop MSExchangeADTopology
net stop MSExchangeAntispamUpdate
net stop MSExchangeEdgeSync
net stop MSExchangeFBA
net stop MSExchangeFDS
net stop MSExchangeIS
net stop MSExchangeMailboxAssistants
net stop MSExchangeMailboxReplication
net stop MSExchangeMailSubmission
net stop MSExchangeProtectedServiceHost
net stop MSExchangeRepl
net stop MSExchangeRPC
net stop MSExchangeSA
net stop MSExchangeSearch
net stop MSExchangeServiceHost
net stop MSExchangeThrottling
net stop MSExchangeTransport
net stop MSExchangeTransportLogSearch
Echo 'Starting Microsoft Exchange Services'
net start MSExchangeAB
net start MSExchangeADTopology
net start MSExchangeAntispamUpdate
net start MSExchangeEdgeSync
net start MSExchangeFBA
net start MSExchangeFDS
net start MSExchangeIS
net start MSExchangeMailboxAssistants
net start MSExchangeMailboxReplication
net start MSExchangeMailSubmission
net start MSExchangeProtectedServiceHost
net start MSExchangeRepl
net start MSExchangeRPC
net start MSExchangeSA
net start MSExchangeSearch
net start MSExchangeServiceHost
net start MSExchangeThrottling
net start MSExchangeTransport
net start MSExchangeTransportLogSearch
End

Open in new window

0
 
LVL 52

Assisted Solution

by:Manpreet SIngh Khatra
Manpreet SIngh Khatra earned 166 total points
ID: 39203432
Much more from the source article itself ...... details or code stated above

http://therealshrimp.blogspot.in/2010/03/restarting-exchange-2010-services.html

Restarting All Running Services
http://www.zerohoursleep.com/2010/09/quick-tip-restarting-all-microsoft-exchange-services/

$services = Get-Service | ? { $_.name -like "MSExchange*" -and $_.Status -eq "Running"}
foreach ($service in $services) {Restart-Service $service.name -Force}


Script allows you to Start, Stop or Restart Exchange Server 2010 service (only in theses Automatic startup mode)
http://certcollection.org/forum/topic/108267-exchange-2010-services-script/

Automatically restart failed Exchange services using PowerShell
http://blogs.technet.com/b/daveh/archive/2008/12/21/automatically-restart-failed-exchange-services-using-powershell.aspx

- Rancy
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now