Jump to content

Printer script and the adding of printers from a long dead server!


Recommended Posts

Posted

I've started using a simple script to map my printers:

 

Set WshNetwork = CreateObject("WScript.Network")
On Error Resume Next
Set oPrinters = WshNetwork.EnumPrinterConnections
       For i = 1 to oPrinters.Count - 1 Step 2
             WshNetwork.RemovePrinterConnection oPrinters.Item(i)
       Next

Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\HP-SERVER\PRINTIT1"
WshNetwork.AddWindowsPrinterConnection "\\HP-SERVER\PRINTIT2"
WshNetwork.AddWindowsPrinterConnection "\\HP-SERVER\PRINTIT3"
WshNetwork.AddWindowsPrinterConnection "\\HP-SERVER\PRINTIT4"
WshNetwork.AddWindowsPrinterConnection "\\HP-SERVER\PRINTLRC"
WshNetwork.AddWindowsPrinterConnection "\\HP-SERVER\PRINTART"
WshNetwork.AddWindowsPrinterConnection "\\HP-SERVER\PRINTMUSIC"

rem ** Setup default printer **
WshNetwork.SetDefaultPrinter "\\HP-SERVER\PRINTLRC"

 

But when the pupils logon they're also getting

 

CF-SERVER\PRINTLRC

CF-SERVER\PRINTIT1

CF-SERVER\PRINTIT2

 

CF-SERVER was the print server but was wiped back in 2008 and doesn't have any printers on it at all.

 

Any idea where it could be pulling this information from? The registry shows nothing for CF-SERVER.

 

TIA

Posted

Just about to add that I've narrowed it down to the pupil's mandatory profile!

 

For some reason it's adding the rogue server to the registry at HKLM\Software\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers

Posted

I've had that problem before, I can't remember how I fixed it. It'll probably be one of these./

 

You can either make a copy of the profile, make it writeable (change ntuser.man to ntuser.man),assign it to an unrestricted account with no GPOS of scripts. Then log in the account remove the printers, log off the profile changes will be saved. Then test the profile and use it to replace the original student profile

 

Of you can use regedit's load hive function to edit the ntuser.man file. Load a hive into the registry: Core Services. Don't edit a live student profile, make a copy edit the copy then test and copy back over.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...