Start and Stop script for exchange 2010

Stop exchange – 

net stop msexchangeadtopology /y
net stop msexchangefba /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y
net stop w3svc /y

Start Exchange –

net start msexchangeadtopology /y
net start msexchangefba /y
net start msftesql-exchange /y
net start msexchangeis /y
net start msexchangesa /y
net start iisadmin /y
net start w3svc /y

Start Automatic Services That Have Stopped

Start Automatic Services That Have Stopped

Source: Lazynetworkadmin.com//

//

script will run as a scheduled task after the servers startup

//

//

‘This script will check a server and make sure all Automatic services are Started
On Error Resume Next

strComputer = “.”

i = 0

intLongSleep = 600000

intShortSleep = 60000

WScript.Sleep intLongSleep

Set objWMIService = GetObject(“winmgmts:” _

& “{impersonationLevel=impersonate}!\” & strComputer & “rootcimv2”)

Set colRunningServices = objWMIService.ExecQuery(“Select * from Win32_Service”)

For Each objService in colRunningServices

‘WScript.Echo objService.Name  & VbTab & objService.StartMode & objService.Started

If objService.StartMode = “Auto” Then

‘WScript.Echo “Found Mode”

Redim Preserve arrStartMode(i)

arrStartMode(i) = objService.Name

i = i + 1

Start = LBound(arrStartMode)

sEnd = UBound(arrStartMode)

‘WScript.Echo objService.Name & VbTab & objService.StartMode & ”  ” & objService.Started

StartSVC()

Else

End If

Next

Function StartSVC()

If objService.Started = False Then

‘WScript.Echo objService.Name & VbTab & objService.StartMode & ”  ” & objService.Started

objService.StartService()

WScript.Sleep intShortSleep

End If

End Function

—–Copy everything above this line—–