From cfd3e9e59bf62e1bda37a6f0f0417efcc286bee0 Mon Sep 17 00:00:00 2001 From: jbousquie Date: Wed, 23 Nov 2016 11:21:54 +0100 Subject: [PATCH] ajout collecte marque, modele, type systeme --- logout.vbs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/logout.vbs b/logout.vbs index 4217a07..43ea48a 100644 --- a/logout.vbs +++ b/logout.vbs @@ -1,9 +1,22 @@ -Dim o, n, data +On error resume next + +'audit des déconnexions active directory +'on émet un POST HTTP, sans passer par le proxy, sur le serveur de log des connexions +Dim o, n, data, secopt Set o = CreateObject("WinHttp.WinHttpRequest.5.1") +strComputer = "localhost" +Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") +Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem") +For Each objItem in colItems + manufacturer = trim(objItem.Manufacturer) + model = trim(objItem.Model) + systemType = trim(objItem.SystemType) +next Set n = CreateObject("wscript.network") o.setproxy 1 -o.open "POST", "http://winlog.dometud.iut-rodez.local/", False +o.Option(4) = 13056 'pour forcer à ignorer toutes les erreurs de certificats +o.open "POST", "https://winlog.iut.local/", False o.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" -data = "action=D&username="+n.Username+"&computer="+n.ComputerName +data = "code=HK9!-uu&action=D&username="+LCase(n.Username)+"&computer="+n.ComputerName+"&manufacturer="+manufacturer+"&model="+model+"&systemType="+systemType o.send data