Ce script va récupérer le nom des ordinateurs contenus dans un fichier Ordinateurs.txt puis écrire dans une feuille Excel le nom de la machine et de son domaine.
Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.Workbooks.Add intRow = 2 objExcel.Cells(1, 1).Value = "Machine Name" objExcel.Cells(1, 2).Value = "Domain" Set Fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("Ordinateurs.txt") Do While Not (InputFile.atEndOfStream) strComputer = InputFile.ReadLine On Error Resume Next Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem") If Err.Number <> 0 Then objExcel.Cells(intRow, 1).Value = UCase(strComputer) objExcel.Cells(intRow, 2).Value = "Not Found" Err.Clear Else For Each objItem in colItems objExcel.Cells(intRow, 1).Value = UCase(objItem.Name) objExcel.Cells(intRow, 2).Value = UCase(objItem.Domain) Next End If intRow = intRow + 1 Loop objExcel.Range("A1:B1").Select objExcel.Selection.Interior.ColorIndex = 19 objExcel.Selection.Font.ColorIndex = 11 objExcel.Selection.Font.Bold = True objExcel.Cells.EntireColumn.AutoFit MsgBox "Done"Ce code est correctement formaté. Vous pouvez directement le COPIER / COLLER dans un fichier VBS.
Devez-vous vraiment installer un VPN sur votre ordinateur ou votre smartphone?
Si vous téléchargez des films illégalement, si vous voulez surfer sur Internet de façon anonyme sans que le gouvernement, votre FAI ou votre employeur soit au courant ... OUI installer un VPN est définitivement une bonne idée.
Installer un VPN consiste à chiffrer toutes vos communications vers Internet. Ce n'est plus votre ordinateur qui est exposé sur Internet mais votre fournisseur de VPN.