- Start-Service
- Syntax
- Description
- Examples
- Example 1: Start a service by using its name
- Example 2: Display information without starting a service
- Example 3: Start a service and record the action in a text file
- Example 4: Start a disabled service
- Parameters
- Inputs
- Outputs
- Notes
- Все о реестре Regedit / All about registry
- Как остановить службу Windows ? / How stop windows service ?
- Запуск и остановка службы сервера отчетов Start and stop the report server service
- Использование программы настройки служб Reporting Services Use the Reporting Services Configuration tool
- Использование средств администрирования Use Administrative Tools
Start-Service
Starts one or more stopped services.
Syntax
Description
The Start-Service cmdlet sends a start message to the Windows Service Controller for each of the specified services. If a service is already running, the message is ignored without error. You can specify the services by their service names or display names, or you can use the InputObject parameter to supply a service object that represents the services that you want to start.
Examples
Example 1: Start a service by using its name
This example starts the EventLog service on the local computer. The Name parameter identifies the service by its service name.
Example 2: Display information without starting a service
This example shows what would occur if you started the services that have a display name that includes «remote».
The DisplayName parameter identifies the services by their display name instead of their service name. The WhatIf parameter causes the cmdlet to display what would happen when you run the command but does not make changes.
Example 3: Start a service and record the action in a text file
This example starts the Windows Management Instrumentation (WMI) service on the computer and adds a record of the action to the services.txt file.
First we use Get-Service to get an object that represent the WMI service and store it in the $s variable. Next, we start the service. Without the PassThru parameter, Start-Service does not create any output. The pipeline operator (|) passes the object output by Start-Service to the Format-List cmdlet to format the object as a list of its properties. The append redirection operator (>>) redirects the output to the services.txt file. The output is added to the end of the existing file.
Example 4: Start a disabled service
This example shows how to start a service when the start type of the service is Disabled.
The first attempt to start the Telnet service (tlntsvr) fails. The Get-CimInstance command shows that the StartMode property of the Tlntsvr service is Disabled. The Set-Service cmdlet changes the start type to Manual. Now, we can resubmit the Start-Service command. This time, the command succeeds. To verify that the command succeeded, run Get-Service .
Parameters
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the display names of the services to start. Wildcard characters are permitted.
Type: | String [ ] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Specifies services that this cmdlet omits. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as s* . Wildcard characters are permitted.
Type: | String [ ] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Specifies services that this cmdlet starts. The value of this parameter qualifies the Name parameter. Enter a name element or pattern, such as s* . Wildcard characters are permitted.
Type: | String [ ] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Specifies ServiceController objects representing the services to be started. Enter a variable that contains the objects, or type a command or expression that gets the objects.
Type: | ServiceController [ ] |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the service names for the service to be started.
The parameter name is optional. You can use Name or its alias, ServiceName, or you can omit the parameter name.
Type: | String [ ] |
Aliases: | ServiceName |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Returns an object that represents the service. By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
System.ServiceProcess.ServiceController, System.String
You can pipe objects that represent the services or strings that contain the service names to this cmdlet.
Outputs
None, System.ServiceProcess.ServiceController
This cmdlet generates a System.ServiceProcess.ServiceController object that represents the service, if you specify PassThru. Otherwise, this cmdlet does not generate any output.
Notes
This cmdlet is only available on Windows platforms.
- You can also refer to Start-Service by its built-in alias, sasv . For more information, see about_Aliases.
- Start-Service can control services only if the current user has permission to do this. If a command does not work correctly, you might not have the required permissions.
- To find the service names and display names of the services on your system, type Get-Service . The service names appear in the Name column, and the display names appear in the DisplayName column.
- You can start only the services that have a start type of Manual, Automatic, or Automatic (Delayed Start). You cannot start the services that have a start type of Disabled. If a Start-Service command fails with the message Cannot start service \ on computer , use Get-CimInstance to find the start type of the service and, if you have to, use the Set-Service cmdlet to change the start type of the service.
- Some services, such as Performance Logs and Alerts (SysmonLog) stop automatically if they have no work to do. When PowerShell starts a service that stops itself almost immediately, it displays the following message: Service \ start failed.
Все о реестре Regedit / All about registry
Как остановить службу Windows ? / How stop windows service ?
Иногда возникает необходимость остановить службу в Windows , например, если возникает подозрение, что приложение не работает из-за работы какой-либо службы.
Сегодня мы рассмотрим пример остановки службы через командную строку.
Для начала, необходимо определиться какую службу мы будет останавливать.
Нажмите Пуск, далее правой кнопкой мыши нажмите по значку Компьютер и выберите пункт Управление.
Если у вас Windows 10, то достаточно нажать правой кнопкой мышки на кнопку Пуск и выбрать пункт Управление компьютером
В окне управления компьютером выбираем Службы и ищем службу интересующую нас службу.
Рассмотрим пример отключения службы Защитник Windows . Не рекомендую отключать данную службу, если у Вас отсутствует Антивирус. Щелкните два раза на службу.
В окне описания службы мы отображено консольное название службы, а именно Windefend
Запустите командную строку сочетанием клавиш Win + R , а в окне Выполнить наберите cmd
В командной строке напишите:
net stop WinDefend
После данных действий служба должна остановиться.
Остановить службу можно и другой командой, а именно командой sc
В описании данной команды есть очень много возможностей.
Командой sc можно запускать, останавливать или запрашивать состояние служб на локальном и удаленном компьютере.
Рассмотрим пример запроса Имени службы через команду sc
На картинке показан запрос имени службы.
Командой sc query | more — мы можем отобразить список Служб на компьютере построчно.
Остановить службу на локальном компьютере можно командой:
sc stop Имя службы
При о запуске, остановке или просмотре состояния службы на удаленном компьютере можно воспользоваться командой sc.
Если вы создаете cmd файл только для локального компьютера, вполне сойдет и net .
Sometimes you need to stop a service in Windows, for example, if you suspect that an application is not running because of a service.
Today we will look at an example of stopping a service via the command line.
For a start, it is necessary to decide what service we will stop.
If you Operation system Windows 7:
Click Start button, right-click Computer, and then click Computer Management
If you have Windows 10, just right — click on the Start button and select Computer Management
In the computer control window, select the Service and look for the service we are interested in.
Consider an example of disabling the Windows Defender service. I do not recommend stop this service if you do not have an antivirus. Double-click the service.
In the service description window, we display the console name of the service, namely Windefend.
Run command prompt (Win+R buttons) in the Run window, type cmd
At the command line, type:
net stop WinDefend
After these actions, the service should stop.
You can also stop the service with another command, namely sc
There are many possibilities in the description of this command.
You can use the sc command to stop services on a remote computer or to query the status of services on a remote computer.
Command sc query |more — we can display the list of Services on the computer line by line.
You can stop the service on the local computer by using the following command
sc stop service Name you service
When you start, stop or view the status of a service on a remote computer, you can use the sc command.
If you are creating a cmd file for your local you can use the net command.
Запуск и остановка службы сервера отчетов Start and stop the report server service
ПРИМЕНИМО К: APPLIES TO: Службы SQL Server 2016 Reporting Services и более поздние версии Сервер отчетов Power BI Службы SQL Server 2016 Reporting Services и более поздние версии Сервер отчетов Power BI
Сервер отчетов реализован как служба Windows, которая включает веб-службу сервера отчетов, веб-портал и приложение фоновой обработки. A report server is implemented as a Windows service that contains the Report Server web service, the web portal, and a background processing application. Чтобы использовать какие-либо функции сервера отчетов, эта служба должна работать. The service must be running if you want to use any report server functionality. Остановка службы приводит к прекращению всех операций сервера отчетов. Stopping the service stops all report server operations.
Пока служба остановлена, запросы для запланированных отчетов и обработки подписок, которые были бы удовлетворены, если бы служба работала, добавляются в очередь. While the service is stopped, requests for scheduled report and subscription processing that would have occurred had the service been running are added to the queue. Это связано с тем, что задания, выполняемые агентом SQL Server SQL Server , создают события. This is because jobs that are run by SQL Server SQL Server Agent create the events. Если требуется предотвратить создание незавершенных операций во время простоя службы, рассмотрите возможность остановить работу агента SQL Server SQL Server . If you want to avoid a backlog of operations while the service is off, consider stopping SQL Server SQL Server Agent as well.
Чтобы запустить или остановить службу сервера отчетов, можно применить ряд средств, включая программу настройки служб Службы Reporting Services Reporting Services , диспетчер конфигурации SQL Server SQL Server и оснастку «Службы», существующую в Microsoft Microsoft Windows. You can use a variety of tools to start or stop the Report Server service, including the Службы Reporting Services Reporting Services Configuration tool, SQL Server SQL Server Configuration Manager, and the Services tool provided in Microsoft Microsoft Windows.
Configuration Manager SQL Server SQL Server — это вариант только для SQL Server Reporting Services 2016 и более ранних версий. SQL Server SQL Server Configuration Manager is only an option for SQL Server Reporting Services 2016 and earlier. Сюда не входят Reporting Services 2017 и более поздних версий или Сервер отчетов Power BI. It does not include Reporting Services 2017 and later or Power BI Report Server.
Чтобы выполнить какие-либо другие операции, кроме запуска и остановки службы, например для смены учетной записи службы, необходимо пользоваться программой настройки служб Службы Reporting Services Reporting Services . If you’re doing more than starting or stopping the service, such as changing the service account, you must use the Службы Reporting Services Reporting Services Configuration tool. Использование для смены учетной записи службы других средств может привести к неработоспособности установки Службы Reporting Services Reporting Services и ключа шифрования. Using other tools to change the service account can break your Службы Reporting Services Reporting Services installation and encryption key. Дополнительные сведения см. в разделе Настройка учетной записи службы сервера отчетов (диспетчер конфигурации сервера отчетов). For more information, see Configure the Report Server Service Account (Report Server Configuration Manager).
Эту службу нельзя приостанавливать и возобновлять, You can’t pause and resume the service. и она не имеет параметров запуска. There aren’t start parameters. Хотя явные зависимости отсутствуют, для поддержки подписок и проводимых по расписанию операций с отчетами на сервере отчетов должен работать агент SQL Server SQL Server . Although there are no explicit dependencies, SQL Server SQL Server Agent must be running if you support any subscriptions or scheduled report operations on the report server.
Использование программы настройки служб Reporting Services Use the Reporting Services Configuration tool
Запустите программу настройки служб Службы Reporting Services Reporting Services и подключитесь к серверу отчетов. Start Службы Reporting Services Reporting Services Configuration tool and connect to the report server.
На странице состояния сервера отчетов нажмите Остановить или Запустить. On the Report Server Status page, select Stop or Start.
Использование средств администрирования Use Administrative Tools
- В разделе средств администрирования выберите Службы. In Administrative Tools, open Services.
- Щелкните правой кнопкой мыши SQL Server Reporting Services (MSSQLSERVER) , SQL Server Reporting Services или Сервер отчетов Power BI. Right-click SQL Server Reporting Services (MSSQLSERVER), SQL Server Reporting Services, or Power BI Report Server.
- Выберите Остановить или Перезапустить. Select Stop or Restart.
Если при использовании Reporting Services 2016 несколько экземпляров выполняется параллельно или сервер отчетов выполняется в качестве именованного экземпляра, убедитесь, что имя экземпляра в круглых скобках соответствует экземпляру сервера отчетов, который нужно остановить или перезапустить. For Reporting Services 2016 and earlier versions, if you are running multiple instances or if the report server is running as a named instance, verify that the instance name in parentheses corresponds to the report server instance you want to stop or restart.