OK, so I have the following script (from the web), which works when testing but isn't working when it is run from a GPO (script set on LogOff):
On Error Resume Next
Dim arrPrinterName()
Dim strComputer, i, PrintServer
Dim objWMIService, objNetwork, colInstalledPrinters, objPrinter
strComputer = "."
i = 0
PrintServer = "Printer Server"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
ReDim Preserve arrPrinterName(i)
arrPrinterName(i) = objPrinter.Name
If InStr(arrPrinterName(i), PrintServer) Then
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.RemovePrinterConnection arrPrinterName(i)
i=i+1
End If
Next
I need to have the script run on logoff and not logon, as any delay in logon and the users will have a fit. I'm not sure why this won't work on logoff but I am going to be testing it today. If anyone has any thoughts please let me know.