Jump to content

kpezza38

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by kpezza38

  1. My script works, it just doesn't work when it is attached to a Group Policy to run at Logon or Logoff (user) or Startup or Shutdown (computer). It looks like it isn't even being applied to the user account or the computer but the policy is enabled and the scope is set for filtering to my account for the moment.
  2. Duke5A, that script is nice but unfortunately doesn't work for me. I am now going to attempt to use brute force to remove the printers because this has dragged on too long.
  3. 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.
  4. Hi Everyone, I was thinking of deleting the old printers via User Config > Control Panel Settings > Printers but I am not sure if this will remove the printer drivers, which I don't want it to do. I only need to target network printers that were created from the old print server, so I was also thinking a vb script would be good but I'm not sure where to start. We can't use Powershell due to security constraints, so that is out of the question. If anyone can shed some light on the subject for me I would appreciate it. For now I will continue researching and testing.
×
×
  • Create New...