Enhanced Security Measures in Place:   To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.

Updates missing force install via XDR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Updates missing force install via XDR

L3 Networker

anyone know if is possible to run script on Cortex XDR and force windows update installation on machines?

Best regards
Tiago Marques
1 accepted solution

Accepted Solutions

L5 Sessionator

Hi @tlmarques, thanks for reaching us using the Live Community.

 

It could be possible by calling the required powershell commands from the Python code supported by the agent. 

Take a look and use this example I have created to automatically lock the screen after 10 minutes of inactivity:

import subprocess

# Set the auto screen lock timeout comand, the value in seconds is defined at "-Value"

result = subprocess.run(['powershell.exe', '-command','New-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System" -Name "InactivityTimeoutSecs" -Value 10 -PropertyType DWord -Force'], shell=True, capture_output=True, text=True)

# Check if the PowerShell command ran successfully and returns a message
if result.returncode == 0:
    print("Auto screen lock timeout set successfully.")
else:
    print("Error setting auto screen lock timeout:")
    print(result.stderr)

If this post answers your question, please mark it as the solution.

 

JM

View solution in original post

1 REPLY 1

L5 Sessionator

Hi @tlmarques, thanks for reaching us using the Live Community.

 

It could be possible by calling the required powershell commands from the Python code supported by the agent. 

Take a look and use this example I have created to automatically lock the screen after 10 minutes of inactivity:

import subprocess

# Set the auto screen lock timeout comand, the value in seconds is defined at "-Value"

result = subprocess.run(['powershell.exe', '-command','New-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System" -Name "InactivityTimeoutSecs" -Value 10 -PropertyType DWord -Force'], shell=True, capture_output=True, text=True)

# Check if the PowerShell command ran successfully and returns a message
if result.returncode == 0:
    print("Auto screen lock timeout set successfully.")
else:
    print("Error setting auto screen lock timeout:")
    print(result.stderr)

If this post answers your question, please mark it as the solution.

 

JM
  • 1 accepted solution
  • 545 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!