+ All Categories
Home > Technology > Windows Services 101

Windows Services 101

Date post: 08-Aug-2015
Category:
Upload: haszeli-food-resources
View: 60 times
Download: 1 times
Share this document with a friend
Popular Tags:
20
Windows Services 101 Nurul Haszeli Ahma 01 June 201
Transcript

Windows Services 101

Nurul Haszeli Ahmad01 June 2015

HIGHLIGHTS

Understanding Windows Services

Programming Windows Services

View Windows Services

What is Windows Services?

References

Creating Windows Services

Windows Services vs Task Scheduler

WHAT IS WINDOWS SERVICES?Windows Services• A.K.A NT Services• long-running executable applications

that run in their own Windows sessions• Runs on background (no UI)• Example services: DB Server, Anti-virus,

SSH, HTTP, Printer Spooler, etc• Configurable:

• Runs on startup (computer boot)• Delay run• Manual / Auto run• Start with parameter• Starts for specific username

• An application can be programmable to run as a services via .NET (creating a Windows Service Application)

VIEW WINDOWS SERVICES1. Command Prompt2. Task Manager3. Services Manager4. Computer Manager

C:\net startC:\net start | more

VIEW WINDOWS SERVICES

1. Command Prompt2. Task Manager3. Services Manager4. Computer Manager

VIEW WINDOWS SERVICES

1. Command Prompt2. Task Manager3. Services Manager4. Computer Manager

VIEW WINDOWS SERVICES

1. Command Prompt2. Task Manager3. Services Manager4. Computer Manager

UNDERSTANDING WINDOWS SERVICES

Services Name

Current Status

Start Mode

Start As/By

• Started• Pause• Pending• Stop

Service Status

• Automatic• Manual• Delay Start• Disabled

Service Start Mode

• Local System• Local Service• Network Service

Start As/By

More info: 1. https://technet.microsoft.com/en-us/library/cc755249.aspx2. http://www.howtogeek.com/school/using-windows-admin-tools-like-a-pro/lesson8/

UNDERSTANDING WINDOWS SERVICES

Parameter that can be changed

SQL Servers start parameter eg:-e [error log path] –g [memory to reserve]

will set error log location and starting memory to be used

UNDERSTANDING WINDOWS SERVICES

Control access to the services

Applicable for hardware based services

UNDERSTANDING WINDOWS SERVICES

Determine the action if the services failed

If three consecutives startup failed, the services can trigger to run a program such as send notifications, log error, etc.

UNDERSTANDING WINDOWS SERVICES

The services/component that the service dependent on

The component/services that has dependencies to the service

UNDERSTANDING WINDOWS SERVICES

Getting response via command prompt

C:\Users\haszeli>sc queryex MSSQL$SQLEXPRESS

SERVICE_NAME: MSSQL$SQLEXPRESS TYPE : 10 WIN32_OWN_PROCESS STATE : 1 STOPPED WIN32_EXIT_CODE : 1077 (0x435) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 PID : 0 FLAGS :

C:\Users\haszeli>

* You can also use net command to perform start/stop/pause/continue a service.

UNDERSTANDING WINDOWS SERVICES

• Not all services it shall runs• Depends on the usage of the PC /

Server

Configuring Services - that you should start / disabled

1. Windows 8.1 - http://www.blackviper.com/service-configurations/black-vipers-windows-8-1-service-configurations/

2. Windows 7 - http://www.blackviper.com/service-configurations/black-vipers-windows-7-service-pack-1-service-configurations/

3. Windows Vista - http://www.blackviper.com/service-configurations/black-vipers-windows-vista-service-pack-2-service-configurations/

4. Windows XP - http://www.blackviper.com/service-configurations/black-vipers-windows-xp-x86-32-bit-service-pack-3-service-configurations/

Others: http://www.blackviper.com/service-configurations/

UNDERSTANDING WINDOWS SERVICES

PROGRAMMING WINDOWS SERVICES

Requirement: Visual Studio (IDE) .NET Framework Programming skill – VB.NET and C# List of possible function callshttps://msdn.microsoft.com/en-us/library/System.ServiceProcess(v=vs.110).aspx

• Creating Windows Services1. Create .NET Windows Services Projecthttps://msdn.microsoft.com/en-us/library/9k985bc9(v=vs.110).aspx 2. Write the programhttps://msdn.microsoft.com/en-us/library/76477d2t(v=vs.110).aspx 3. Code the serviceshttps://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx

CREATING WINDOWS SERVICES

Creating services using Sc.exe commandhttps://support.microsoft.com/en-us/kb/251192https://technet.microsoft.com/en-us/library/cc990289.aspx

Install and uninstall windows services program created using .NEThttps://msdn.microsoft.com/en-us/library/sd8zc8ha(v=vs.110).aspxhttp://stackoverflow.com/questions/8164859/install-a-windows-service-using-a-windows-command-prompthttps://coderamblings.wordpress.com/2012/07/24/how-to-install-a-windows-service-using-the-command-prompt/

WINDOWS SERVICES VS

TASK SCHEDULERWindows Services Task Scheduler

Running a permanent or continuous operation/task

Running a program/apps once a while (on frequency basis)

When a service is required to provide data/operation when needed/triggered

Running at its own pace. Process and provide output but does not dependent on other program/input

Complex program and/or application that is very complex in coding and processing

Simple operation or program that can be easily managed

Triggered via events or programs

Triggered via time

REFERENCES1. https://msdn.microsoft.com/en-us/library/d56de412(v=vs.110).aspx2. http://www.top-windows-tutorials.com/windows-services/3. https://www.sophos.com/en-us/support/knowledgebase/11299.aspx4. http://

www.7tutorials.com/what-are-windows-services-what-they-do-how-manage-them

5. https://technet.microsoft.com/en-us/library/cc736564(v=ws.10).aspx

6. https://msdn.microsoft.com/en-us/library/7. http://www.howtogeek.com/school/using-windows-admin-tools-like-

a-pro/lesson8/

8. https://technet.microsoft.com/en-us/library/cc755249.aspx9. http://

windows.microsoft.com/en-us/windows-vista/manage-services-in-windows-vista-from-windows-vista-inside-out

10.https://msdn.microsoft.com/en-us/ms190737.aspx 11.http://weblogs.asp.net/jongalloway//428303 12.http://dejanstojanovic.net/aspnet/2014/december/windows-schedul

ed-task-vs-windows-service/

Thank you.


Recommended