From c63e8744ab91be5afec4e96f8d95d082081e36d6 Mon Sep 17 00:00:00 2001 From: Nicolas Lang Date: Sat, 16 Dec 2023 16:58:45 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Windows/scheduled_tasks.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Windows/scheduled_tasks.ps1 diff --git a/Windows/scheduled_tasks.ps1 b/Windows/scheduled_tasks.ps1 new file mode 100644 index 0000000..7eed8f3 --- /dev/null +++ b/Windows/scheduled_tasks.ps1 @@ -0,0 +1,13 @@ +#Script créé par Nicolas Lang - Sous licence CC-BY-SA +#https://nicolaslang.fr + +[xml]$taches = schtasks /query /s "Nom_serveur" /xml one +$tableau = New-object System.Collections.ArrayList +$i = 0 +$taches.tasks.'#comment' | % {$add = [pscustomobject]@{ +"Serveur" = "Nom_du_serveur" +"Name" = $_ +"Utilisateur" = $taches.tasks.task[$i].Principals.principal.userid} +$i++ +$tableau.add($add) | Out-Null} +$tableau | Where-object {$_.utilisateur -like "*administrateur*"} \ No newline at end of file