Quantcast
Viewing all articles
Browse latest Browse all 21

Check Service Status and Start Service

You can click on the images to enlarge them!

After the solution for the issue in this post I encountered the issue in overabundance. Even when the start mode is set to ‘Automatic’ the service will not start when my computer starts up.

Image may be NSFW.
Clik here to view.

So I needed a Solution. PowerShell is probably suited for solving this issue. So why don’t search for an Solution in some PowerShell script?

Image may be NSFW.
Clik here to view.

This code will effect the following marked service, shown here in SQL Server Configuration Manager:

Image may be NSFW.
Clik here to view.

After executing the code the service State is changed to Running!

Image may be NSFW.
Clik here to view.

Execute the code from the Windows PowerShell Prompt. This path can also be used in a batch file when you start op your environment (Just click on the image to see the whole command line).

Image may be NSFW.
Clik here to view.

Checking the status of the Service. When the status is Stopped, the code will Start the Service and the Service status will change to Running (for result in SQL Server Configuration Manager hit F5 (Refresh)).

Image may be NSFW.
Clik here to view.

If the Service is already Running, the code will write out the following:

Image may be NSFW.
Clik here to view.

So, for using this PowerShell Script when starting up your environment just use a batch file with the path to the PowerShell File

In my case: C:\Users\Bas\Desktop\Macaw\Macaw PowerShell\CheckandStartServices.ps1

Good Luck!


Viewing all articles
Browse latest Browse all 21

Trending Articles