Posts tagged: print

Normal user cannot add a network printer on a Terminal Server

By default Windows 2000 and 2003 terminal services does not allow a non administration account to add a printer when they log onto a remote desktop connection. When they do attempt to install a printer the user gets the following error message.

You do not have sufficient access to your computer to connect to the selected printer.

To allow users to add a network printer either manually or via a logon script you will need to do the following:

  1. Open up local security policy by clicking “Start -> Programs -> Administrative Tools -> Local Security Policy“.
  2. Open Local Policies
  3. Open Security Policies
  4. On the Right hand side double-click “Prevent users from installing printer drivers”
  5. Click on Disabled and then Ok and then Close the Local Security Policy window.
  6. Reboot the computer

Apparently you can do a gpupdate /force (win 2003) or a secedit /REFRESHPOLICY MACHINE_POLICY /enforce (windows 2000) instead of rebooting but I have not tried that myself and its been just as easy to reboot the server.

You can also set this setting on the Terminal Servers OU through group policy if you have multiple Terminal Servers to save time.

  • Share/Bookmark

Delete Network Printers using VBScript

The script below will delete all network printers  from the user profile but will not remove any of the local printers. This is quite useful if you have roaming profiles and want to remove mapped printers before running computer/OU specific scripts to map other printers.

You will need to copy the below into a notepad document and save with a .vbs extension.

‘————————————————————————-

‘– Removes all network printers but not any local printers–

‘————————————————————————-

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2″)

Set colInstalledPrinters =  objWMIService.ExecQuery _
(“Select * from Win32_Printer Where Network = TRUE”)

For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next

‘————————————————————————-

I have tested this under Windows XP and Windows 7 and appears to work properly. I don’t have any more Vista machines but it should work fine on that also.

  • Share/Bookmark

Remove all Network Printers using VBScript

To delete a network printer using a login script you can use the following vb code. Just copy and paste the text into a new file called DeleteNetworkPrinters.vbs and call it from within your login script.

This will not delete any local printers installed to the machine. This is really useful to put in before you start mapping network printers during user logon.

‘————————————————————————-

‘– Removes all network printers but not any local printers–

‘————————————————————————-

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2″)

Set colInstalledPrinters =  objWMIService.ExecQuery _
(“Select * from Win32_Printer Where Network = TRUE”)

For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next

‘————————————————————————-

I’ve tested this code on Windows XP and Windows 7 and it works fine. I’m going to assume this is working on Windows Vista as well.

  • Share/Bookmark