le script
'2014 07 24 : Liste les imprimantes d'une serveur ou autre machine Windows.
ListeMachines = "NomMachine01;NomMachine02;NomMachine03"
'ListeMachines = "."
TableauMachines = Split(ListeMachines,";")
Wscript.Echo "Computername" & VbTab & "ShareName" & VbTab & "drivername" & VbTab & "Comment" & VbTab & "DeviceID" & VbTab & "Published" & VbTab & "Shared" & VbTab & "Location"
For each strComputer in TableauMachines
Err.Clear
On Error Resume Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
If Err.number = 0 Then
Set colPrinters = objWMIService.ExecQuery ("Select * From Win32_Printer")
For Each objPrinter in colPrinters
Wscript.Echo strComputer & VbTab & objPrinter.ShareName & VbTab & objPrinter.drivername & VbTab & objPrinter.Comment & VbTab & objPrinter.DeviceID & VbTab & objPrinter.Published & VbTab & objPrinter.Shared & VbTab & objPrinter.Location
Next
Set objWMIService = Nothing
End If
Next
Lien vers le fichier : cliquez ici
Article(s) suivant(s)
Article(s) en relation(s)