S
Stefan Kostet
Hellow
I have build a VBScript that takes away all printer
connection in Windows 2003 AD, that the user dont have
access to. it working fine in Windows XP clients, but not
in Windows 2000 TS server. I have uppgrade VBScript
enginee to V5.6.0.8825 but no results. The script look
like this..
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("SELECT * FROM Win32_Printer WHERE PrinterStatus =
1" _
& "OR PrinterStatus = 2")
If colInstalledPrinters.Count = 0 Then
Else
For Each objPrinter in colInstalledPrinters
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.RemovePrinterConnection objprinter.Name
Next
End If
I have build a VBScript that takes away all printer
connection in Windows 2003 AD, that the user dont have
access to. it working fine in Windows XP clients, but not
in Windows 2000 TS server. I have uppgrade VBScript
enginee to V5.6.0.8825 but no results. The script look
like this..
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("SELECT * FROM Win32_Printer WHERE PrinterStatus =
1" _
& "OR PrinterStatus = 2")
If colInstalledPrinters.Count = 0 Then
Else
For Each objPrinter in colInstalledPrinters
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.RemovePrinterConnection objprinter.Name
Next
End If