Bonjour,

j'ai repris ce script powershell :
Code PowerShell : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Logon Script that will auto-logoff a user after a specified amount of time has passed,
# and will give a warning of the impending logoff at a specified amount of time beforehand.
# The Warning Message has 10 second timeout so that the user can't postpone the logoff forever.
$maxTime = 1 # hours
$warnTime = 30 # minutes
$msgTimeout = 10 # seconds
$WarningMSG = "Attention "user" ! Fermeture de session dans $warnTime secondes"
# ========================================================================================================
# Calculate Time To Sleep
$sleepyTime = $maxTime * 60 * 1
$warningTime = $warnTime * 1
Sleep -Seconds ($sleepyTime - $warningTime)
$wshell = New-Object -ComObject Wscript.Shell
$wshell.Popup($WarningMSG,$msgTimeout,"Automatic Logoff Incoming...",0x0)
Sleep -Seconds $warningTime
# ADD LOGOFF CODE BELOW!
Shutdown -l -f
Shutdown -l -f

Le problème c'est que la fenêtre prévenant de la fermeture de session n'apparaît pas lors d'une partie de jeu.
Elle reste en arrière plan.
Est ce qu'il existe une commande pour forcer la mise au premier plan ?

Je vous remercie.

Bonne soirée
Steph