Forge Home

wmi

A defined type for managing WMI objects with Puppet. Improved version

5,793 downloads

5,793 latest version

2.2 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.1.1 (latest)
released Sep 18th 2017

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'ricardogaspar2-wmi', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ricardogaspar2-wmi
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ricardogaspar2-wmi --version 0.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

ricardogaspar2/wmi — version 0.1.1 Sep 18th 2017

Module wmi

Original project from Puppet Forge:

changed by @ricardogaspar2 (Ricardo Gaspar)

Overview

This module is a defined type to manage WMI objects on Windows. It has been tested on Windows Server 2012 R2.

Module Description

This is a fairly simple type to set the values for WMI objects so you don't have to fight Puppet DSL wrapping up PowerShell with all the right syntax.

Usage

To use the wmi type, you must specify as least the namespace, class, property and value (as shown below). When a value for wmi_method is not provided it will change only the property specified. Otherwise, it will use the method provided. Be aware that you should always use the class method whenever it is available. That's the correct usage. Otherwise the property might not be changed properly.

Using properties

These examples will set the property value directly without calling any method. Because there isn't any available.

wmi { 'Change RDS RDP-TCP Environment Setting':
  wmi_namespace => 'root/cimv2/terminalservices',
  wmi_class     => 'Win32_TSEnvironmentSetting',
  wmi_property  => 'InitialProgramPolicy',
  wmi_value     => '2',
}
wmi { 'Install SSL Certificate for RDP':
    wmi_namespace => 'root/cimv2/terminalservices',
    wmi_class     => 'Win32_TSGeneralSetting',
    wmi_property  => 'SSLCertificateSHA1Hash',
    wmi_value     => '669A9C961733A05F228CD12AA9C6D5DAFE48FA58', 
  }

Using methods

These examples use specified methods.

wmi { 'Remote Desktop - Allow Connections' :
  wmi_namespace => 'root/cimv2/terminalservices',
  wmi_class     => 'Win32_TerminalServiceSetting',
  wmi_property  => 'AllowTSConnections',
  wmi_value     => '1',
  wmi_method    => 'SetAllowTSConnections',
}
wmi { 'Remote Desktop - Set Encription Level':
  wmi_namespace => 'root/cimv2/terminalservices',
  wmi_class     => 'Win32_TSGeneralSetting',
  wmi_property  => 'MinEncryptionLevel'
  wmi_value     => '1',
  wmi_method    => 'SetEncryptionLevel',
}