Skip to content

ErrorWorld

For every 1603 in the World

ErrorWorld

Tag: service

Start Service, if stopped (PS)

Verify if service is stopped, then start it. Afterwards verify the status of the service (Windows Update)

if ($(Get-Service -DisplayName "Windows Update").Status -ne "Running") { (Get-Service -DisplayName "Windows Update").Start() }
(Get-Service -DisplayName "Windows Update").Status
Author ThomasPosted on August 1, 2014December 11, 2021Categories windows client, windows serverTags oneline, powershell, ps1, service

Stop Service, if running (PS)

Verify if service is running, then stop it. Afterwards verify the status of the service (Windows Update).

if ($(Get-Service -DisplayName "Windows Update").Status -eq "Running") { (Get-Service -DisplayName "Windows Update").Stop() }
(Get-Service -DisplayName "Windows Update").Status

Note: Remember to run as Administrator …

Author ThomasPosted on July 31, 2014December 11, 2021Categories windows client, windows serverTags oneline, powershell, ps1, service

Geeks

  • Johan Arwidmark
  • Kent Agerlund
  • Mikael Nystrom
  • Per Larsen
  • Ronni Pedersen

General

  • Hey, Scripting Guy!
  • IT-Ninja
  • Microsoft Script Center
  • MSI Errors
  • Windows Client
  • Windows Sysinternals

LinkedIn

  • Application Re-Packaging
  • APT&P
  • DKMCP
  • DKVUG
  • MSI Packagers
  • SCUG

Microsoft

  • Microsoft Portals

Products

  • ConfigMgr
  • MDOP
  • WPKG

Tools

  • Virus Total

Tags

  • active directory
  • ad
  • azure
  • c2r
  • click to run
  • cmd
  • command line
  • command shell
  • config.xml
  • deploy
  • disable
  • error code
  • feature
  • filepath
  • gpo
  • group policy
  • local
  • mdt
  • microsoft office
  • msi
  • msiexec
  • o365
  • office
  • office 365
  • office 2010
  • office 2013
  • office 2016
  • oneline
  • packaging
  • powershell
  • property
  • ps1
  • registry
  • remote assistance
  • sccm
  • script
  • security
  • unblock file
  • windows
  • windows 7
  • windows 8
  • windows 10
  • windows installer
  • windows update
  • x64
ErrorWorld Proudly powered by WordPress