salt.modules.win_system

Support for reboot, shutdown, etc

salt.modules.win_system.get_computer_desc()

Get the Windows computer description

CLI Example:

salt 'minion-id' system.get_computer_desc
salt.modules.win_system.get_computer_name()

Get the Windows computer name

CLI Example:

salt 'minion-id' system.get_computer_name
salt.modules.win_system.get_pending_computer_name()

Get a pending computer name. If the computer name has been changed, and the change is pending a system reboot, this function will return the pending computer name. Otherwise, None will be returned. If there was an error retrieving the pending computer name, False will be returned, and an error message will be logged to the minion log.

CLI Example:

salt 'minion-id' system.get_pending_computer_name
salt.modules.win_system.get_system_date()

Get the Windows system date

CLI Example:

salt '*' system.get_system_date
salt.modules.win_system.get_system_time()

Get the Windows system time

CLI Example:

salt '*' system.get_system_time
salt.modules.win_system.halt(timeout=5)

Halt a running system

CLI Example:

salt '*' system.halt
salt.modules.win_system.init(runlevel)

Change the system runlevel on sysV compatible systems

CLI Example:

salt '*' system.init 3
salt.modules.win_system.join_domain(domain=None, username=None, password=None, account_ou=None, account_exists=False)

Join a computer to an Active Directory domain

domain
The domain to which the computer should be joined, e.g. my-company.com
username
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
Password of the specified user
account_ou : None
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 : False
Needs to be set to True to allow re-using an existing account

CLI Example:

salt 'minion-id' system.join_domain domain='domain.tld' \
                 username='joinuser' password='joinpassword' \
                 account_ou='ou=clients,ou=org,dc=domain,dc=tld' \
                 account_exists=False
salt.modules.win_system.poweroff(timeout=5)

Poweroff a running system

CLI Example:

salt '*' system.poweroff
salt.modules.win_system.reboot(timeout=5)

Reboot the system

CLI Example:

salt '*' system.reboot
salt.modules.win_system.set_computer_desc(desc)

Set the Windows computer description

CLI Example:

salt 'minion-id' system.set_computer_desc 'This computer belongs to Dave!'
salt.modules.win_system.set_computer_name(name)

Set the Windows computer name

CLI Example:

salt 'minion-id' system.set_computer_name 'DavesComputer'
salt.modules.win_system.set_system_date(newdate)

Set the Windows system date. Use <mm-dd-yy> format for the date.

CLI Example:

salt '*' system.set_system_date '03-28-13'
salt.modules.win_system.set_system_time(newtime)

Set the Windows system time

CLI Example:

salt '*' system.set_system_time '11:31:15 AM'
salt.modules.win_system.shutdown(timeout=5)

Shutdown a running system

CLI Example:

salt '*' system.shutdown
salt.modules.win_system.shutdown_hard()

Shutdown a running system with no timeout or warning

CLI Example:

salt '*' system.shutdown_hard
salt.modules.win_system.start_time_service()

Start the Windows time service

CLI Example:

salt '*' system.start_time_service
salt.modules.win_system.stop_time_service()

Stop the Windows time service

CLI Example:

salt '*' system.stop_time_service