• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

TECHDIIP

  • Tech
  • Windows
  • Powershell
  • Scripts
  • News
  • Games

Powershell set service startup disabled on remote computers

This article explains how to set a service startup disabled state on windows computer remotely using Powershell script, one can also use the same script stop the service on multiple remote computers.

When you want to change service startup we must stop the service first on a desktop computer or a server, we generally open the service console (services.msc) and find the name of service and we stop and change startup to disable, it’s manual if you want to do the same for more computers it is difficult to log in to each server and stop the service and change the startup, here in this article I will explain how to stop a service and set service state to disabled using the simple Powershell script…

Powershell Set-Service

This PowerShell command sets specified service to automatic, delayed, stoped, and system depending on the need we have to choose the option, in our case, we going to disabled the startup type.

As I said earlier we need to stop service first to set the startup service to disabled, and let’s take the service name Adobe Acrobat Update and stop it,

Stop-Service -Name AdobeARMservice -force

Let’s get the status of this service.

PS C:\Windows\system32> get-Service -Name AdobeARMservice

Status   Name               DisplayName
------   ----               -----------
Stopped  AdobeARMservice    Adobe Acrobat Update Service

See the Service is stopped.

 Now let’s disable the service startup

Set-Service -Name AdobeARMservice -StartupType Disabled
# The code disables the adobeARMservcie startup
Set-service StartupType Disabled
startup disabled

Disable service startup on multiple computer

We need to create a file for storing all the servers or multiple machines list, I named it as Allservers.txt for and saved it in my local machine c:\temp\Allserve.txt

$Allserver = Get-Content -Path "C:\temp\AllServer.txt" 

foreach ($server in $allserver) 
{ 
Write-Host "Currently the script is stopping the serivce on" $server 

Invoke-Command -ComputerName $server -ScriptBlock {Get-Service -Name AdobeARMservice | Stop-Service -Force} 

Write-Host "Currently the script is changing startup serivce on" $server
 
Invoke-Command -ComputerName $server -ScriptBlock {Set-Service -Name AdobeARMservice -StartupType Disabled }

}

The above powershell code stops the service first if it is running then sets the service startup to disabled state.

One should have admin rights to execute this script on remote computers, generally, system admins have privilege access to computers, if not one will run into permission or access denied issues, make sure you have admin rights on the remote computers.

Thank you for reading this article, if you have any questions please let us know.

Thank you for visiting my site, for any scripts in these articles you are testing please make sure you have tested this script in our lower environment before you run in production.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Fixed : Page fault in nonpaged area 2022
  • Solved: Ethernet doesn’t have a valid IP configuration 2022
  • 5 Best Free Youtube Video to MP3 Converters in 2022
  • Fixed : Audio renderer error 2022
  • Fixed: Discord search not working 2022
  • About Us
  • CONTACT US
  • Disclaimer
  • Privacy Policy

Copyright © 2022 techdiip.com