Stop a Windows service

This version is out of date. For current versions, see Puppet Enterprise support lifecycle.
Sections

Some services can impair performance, or might need to be stopped for regular maintenance.

To disable a service, use the code:
service { '<service name>':
   ensure => 'stopped',
   enable => 'false'
}

Example

For example, this disables the disk defragmentation service, which can negatively impact service performance.
 service { 'defragsvc':
  ensure => 'stopped',
  enable => 'false'
}
See an issue? Please file a JIRA ticket in our [DOCUMENTATION] project
Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.