Page 1 of 2

[SOLVED] Restarting or shutting down workstations

Published: August 6, 2022 - 6:52 PM
by adgm11
Hello
, I can't restart or shut down a unit in the console. Only Wake-on-LAN to start a unit works. The other functions are grayed out. How do I enable them?

WAPT Discovery 2.2.1

Re: Restarting or shutting down workstations

Published: August 8, 2022 - 09:28
by t.heroult
Good morning

The options must be enabled in the target's wapt-get.ini file.
You can do this by checking the corresponding boxes when creating the agent, or configure it during installation by writing the following lines in setup.py:

Code: Select all

inifile_writestring(WAPT.config_filename, 'global', 'allow_remote_reboot', 1)
inifile_writestring(WAPT.config_filename, 'global', 'allow_remote_shutdown', 1) 
1 is to activate, 0 is to deactivate.

Re: Restarting or shutting down workstations

Published: August 10, 2022 - 11:56
by adgm11
Hello,
editing the wapt-get.ini file and changing the allow_remote_reboot and shutdown values ​​to 1 didn't work. I restarted the service on the client machine and rebooted. But the option remains grayed out in the console. Is there anything I can do on the host machine that has the console?
As for the setup.py file, I don't see how to modify it since I have to use wapt-deploy on the client machines, which is an .exe file. I run it via a batch command on each machine.
The only file I can modify is the setup.py file from the waptupgrade package.

here is the ini file which seems modified but has no impact
[global]
repo_url=https://172.16.11.11/wapt
send_usage_report=1
use_hostpackages=1
wapt_server=https://172.16.11.11
use_kerberos=0
check_certificates_validity=1
verify_cert=0
use_repo_rules=0
allow_remote_reboot=1
allow_remote_shutdown=1
max_gpo_script_wait=180
pre_shutdown_timeout=180
hiberboot_enabled=0
[wapt-templates]
repo_url=https://store.wapt.fr/wapt
verify_cert=1
[waptwua]
default_allow=false
install_at_shutdown=false

Re: Restarting or shutting down workstations

Published: August 11, 2022 - 09:34
by t.heroult
For the WAPT deployment, what I do is there is a GPO that installs a basic agent.
Next, when the PC is in WAPT, it will receive a package to install the latest version of WAPT to keep it up to date. This package contains a configuration.
In the Tranqui IT repository, there is also a small package used solely for WAPT configuration

Code: Select all

tis-wapt-conf-policy
With this, it's quite easy to redo the agent configuration.

However, I'm going to let the Tranquil IT techs look into with you why it's not working in the console.

Sincerely,
Tom

Re: Restarting or shutting down workstations

Published: August 19, 2022 - 11:25
by alain17
Good morning,

I have a similar problem, though perhaps not 100% identical (WAPT 2.2.2 Enterprise version). I'll report it here anyway: when I deploy a copy of tis-wapt-conf-policy with the following content, the deployment goes smoothly:

Code: Select all

def install():
    print("Applying WAPT Configuration Policy")

    # Editing wapt-get.ini of the WAPT Agent
    inifile_writestring(WAPT.config_filename, 'global', 'allow_remote_reboot', 1)
    inifile_writestring(WAPT.config_filename, 'global', 'allow_remote_shutdown', 1)

    print("Reloading WAPT configuration")
    WAPT.reload_config_if_updated()


def uninstall():
    print("Reverting WAPT Configuration Policy")

    # Remove options from the wapt-get.ini of the WAPT Agent
    inifile_deleteoption(WAPT.config_filename, 'global', 'allow_remote_reboot')
    inifile_deleteoption(WAPT.config_filename, 'global', 'allow_remote_shutdown')

    print("Reloading WAPT configuration")
    WAPT.reload_config_if_updated()
However, when I check the configuration on the test machine, its configuration has indeed been updated, however the allow_remote_reboot and allow_remote_shutdown values ​​are reset to 0. I should point out that I also configured a package to update the agent, and that it is supposed to activate these values, which I still cannot get to work.

The logs do not show any errors, but indicate that the package was deployed correctly (I see the "Applying" and "Reloading" traces as indicated in the install() function.

If I manually change the values ​​and restart the WAPT service (or the computer), something resets the values ​​to 0, which is quite strange...

EDIT: For some cryptic reason, I managed to apply the reboot and shutdown configuration to another system. As a precaution, I defined the WAPT agent package as a dependency for the update package in wapt-get.ini. This should make things more stable in the future, as the agent will be updated before the configuration is applied, which should help.

Re: Restarting or shutting down workstations

Published: August 19, 2022 - 4:26 PM
by adgm11
So I don't quite understand what I'm supposed to do. If modifying the wapt-get.ini file with the values ​​"1" in the right places doesn't work, what else needs to be done to make it recognized in the console?

"I defined the WAPT agent package as a dependency for the wapt-get.ini update package" - I didn't quite understand that part, how is that done?
Are we talking about the waptupgrade package? Because I still don't see how it's possible to have a wapt-agent package if the machine hasn't yet been installed via GPO, for example.

Re: Restarting or shutting down workstations

Published: August 21, 2022 - 1:07 PM
by adgm11
Hello. Is this option included in Discovery mode or is an Enterprise license required?

Re: Restarting or shutting down workstations

Published: August 22, 2022 - 3:42 PM
by dcardon
Yes, it's only available with an enterprise license. If the menus aren't grayed out in the console, it's an error; we must have missed that during the merging of the enterprise and community code into a single binary.

Regards,

Denis Cardon

Re: [SOLVED] Restarting or shutting down workstations

Published: August 22, 2022 - 6:30 PM
by adgm11
Phew, thank you! That explains everything; I was starting to tear my hair out.
In discovery mode, the restart and shut down actions are therefore logically greyed out in the context menu.

Re: [SOLVED] Restarting or shutting down workstations

Published: August 22, 2022 - 6:35 PM
by dcardon
Yes, that's right, it's normal that they're greyed out in Discovery mode.

Regards,

Denis