salt.states.win_system

Management of Windows system information

New in version 2014.1.0.

This state is used to manage system information such as the computer name and description.

ERIK-WORKSTATION:
  system.computer_name: []

This is Erik's computer, don't touch!:
  system.computer_desc: []

salt.states.win_system.computer_desc(name)

Manage the computer's description field

name

The desired computer description

salt.states.win_system.computer_name(name)

Manage the computer's name

name

The desired computer name

salt.states.win_system.hostname(name)

New in version 2016.3.0.

Manage the hostname of the computer

name

The hostname to set

salt.states.win_system.join_domain(name, username=None, password=None, account_ou=None, account_exists=False, restart=False)

Checks if a computer is joined to the Domain. If the computer is not in the Domain, it will be joined.

Parameters
  • name (str) -- The name of the Domain.

  • username (str) -- Username of an account which is authorized to join computers to the specified domain. Need to be either fully qualified like user@domain.tld or simply user.

  • password (str) -- Password of the account to add the computer to the Domain.

  • account_ou (str) -- The DN of the OU below which the account for this computer should be created when joining the domain, e.g. ou=computers,ou=departm_432,dc=my-company,dc=com.

  • account_exists (bool) -- Needs to be set to True to allow re-using an existing computer account.

  • restart (bool) -- Needs to be set to True to restart the computer after a successful join.

Example:

join_to_domain:
  system.join_domain:
    - name: mydomain.local.com
    - username: [email protected]
    - password: mysecretpassword
    - restart: True

salt.states.win_system.reboot(name, message=None, timeout=5, force_close=True, in_seconds=False, only_on_pending_reboot=True)

Reboot the computer

Parameters
  • message (str) --

    An optional message to display to users. It will also be used as a comment in the event log entry.

    The default value is None.

  • timeout (int) --

    The number of minutes or seconds before a reboot will occur. Whether this number represents minutes or seconds depends on the value of in_seconds.

    The default value is 5.

  • in_seconds (bool) --

    If this is True, the value of timeout will be treated as a number of seconds. If this is False, the value of timeout will be treated as a number of minutes.

    The default value is False.

  • force_close (bool) --

    If this is True, running applications will be forced to close without warning. If this is False, running applications will not get the opportunity to prompt users about unsaved data.

    The default value is True.

  • only_on_pending_reboot (bool) --

    If this is True, the reboot will only occur if the system reports a pending reboot. If this is False, the reboot will always occur.

    The default value is True.

salt.states.win_system.shutdown(name, message=None, timeout=5, force_close=True, reboot=False, in_seconds=False, only_on_pending_reboot=False)

Shutdown the computer

Parameters
  • message (str) --

    An optional message to display to users. It will also be used as a comment in the event log entry.

    The default value is None.

  • timeout (int) --

    The number of minutes or seconds before a shutdown will occur. Whether this number represents minutes or seconds depends on the value of in_seconds.

    The default value is 5.

  • in_seconds (bool) --

    If this is True, the value of timeout will be treated as a number of seconds. If this is False, the value of timeout will be treated as a number of minutes.

    The default value is False.

  • force_close (bool) --

    If this is True, running applications will be forced to close without warning. If this is False, running applications will not get the opportunity to prompt users about unsaved data.

    The default value is True.

  • reboot (bool) --

    If this is True, the computer will restart immediately after shutting down. If False the system flushes all caches to disk and safely powers down the system.

    The default value is False.

  • only_on_pending_reboot (bool) --

    If this is True, the shutdown will only occur if the system reports a pending reboot. If this is False, the shutdown will always occur.

    The default value is False.

salt.states.win_system.workgroup(name)

New in version 3001.

Manage the workgroup of the computer

Parameters

name (str) -- The workgroup to set

Example:

set workgroup:
  system.workgroup:
    - name: local

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/states/all/salt.states.win_system.html