Not sure if this would help you or not, I would map the network
printers through a script that runs when they would login to my AD.
We were only using XP so I can't confirm that this works with Windows
2000 workstations as I know the WSCRIPT is newer with XP.
-t
PS: Of course you need to change the extension to .vbs to run it
On 7/26/07, Ehren Benson <[log in to unmask]> wrote:
>
>
>
>
> Hey NAG-
>
>
>
> I have a sticky problem that is eluding me causing grief. In one of our
> labs I this command to connect a network printer and make it available to
> all users of the computer:
>
>
>
> rundll32 printui.dll,PrintUIEntry /ga /n\\server\%printername%
>
>
>
> The command seems to have worked because when I connect with any user that
> has admin rights the printer shows up and works just fine. However when I
> log in with the normal account that would be used on the computer which is
> just a normal user account the printer does NOT show up.
>
>
>
> Also when I browse for the printer and right click on it and click connect
> to connect it manually I get the following error:
>
>
>
> "You do not have sufficient access to your computer to connect to the
> selected printer".
>
>
>
> When I add this user to the local administrators group and log off and log
> in, as I said the printer shows up and works. Then if I remove them from
> the local administrators group and log off and log back on it does not and
> will not even let me manually connect to it.
>
>
>
> I am assuming that the error is why the printer is not showing up. Does
> anyone have any ideas what I can do to give that user sufficient access to
> the computer to connect to the printer?
>
>
>
> With 2003 that error is easy to fix as you just add that user that is
> enabled on the "enable users to install printer drivers", but in XP there
> is no such local policy (that I can find) Client OS is XP Pro SP2. Has
> anyone else ran into this?
>
>
>
>
>
> Ehren J. Benson, MCSE
>
> Windows Systems Administrator
>
> Department of Physics and Astronomy
>
> Michigan State University
>
> 1209 A Biomed Phys Sci
>
>
>
> [log in to unmask]
>
> 517-355-9200 x2569
>
>
--
Troy D Murray
Blog: http://troymurray.blogspot.com/
AIM: troymurray72
Skype: troy.murray
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Script Objective:
'
' To map network drive(s) to user workstation
'
'
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Created by: Troy D Murray
' Created on: 8/9/2006 @4:38p
' File name: MapNetworkPrinters2.vbs
' Notes: Initial script creation.
'
'
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Updated by:
' Updated on:
' File name:
' Notes:
'
'
'
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Header Section
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Create variables for reference
'
On Error Resume Next
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Reference Section
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Assign variables their values or references
'
strComputer = "."
strOsVersion = ""
strDefaultPrinterNetworkUnc = ""
strPrinters = ""
' Add printer mappings here to include in the script when the user logs in
' NOTE: You must include a comma between the drive letter and
' path as well as a semi-colon at the end of the path!
strPrinters = strPrinters & "\\srvr-print1\F1_IS_DELL3100;"
strPrinters = strPrinters & "\\srvr-print1\F1_IS_DJ500;"
strPrinters = strPrinters & "\\srvr-print1\F1_IS_LJ5;"
strPrinters = strPrinters & "\\srvr-print1\F1_MAIL_LJ4050;"
strPrinters = strPrinters & "\\srvr-print1\F2_CLAIMS_LJ2500;"
strPrinters = strPrinters & "\\srvr-print1\F2_CLAIMS_LJ4250;"
strPrinters = strPrinters & "\\srvr-print1\F2_CLAIMS_RICOH2051;"
strPrinters = strPrinters & "\\srvr-print1\F2_FINANCE_LJ4000;"
strPrinters = strPrinters & "\\srvr-print1\F2_MBRSVC_LJ4250;"
strPrinters = strPrinters & "\\srvr-print1\F2_MBRSVCS_LJ5550;"
strPrinters = strPrinters & "\\srvr-print1\F2_PC_DELL5100;"
strPrinters = strPrinters & "\\srvr-print1\F2_PC_LJ4050;"
strPrinters = strPrinters & "\\srvr-print1\F3_EXECUTIVE_BI2300;"
strPrinters = strPrinters & "\\srvr-print1\F3_NBT_DELL5100;"
strPrinters = strPrinters & "\\srvr-print1\F3_NBT_RICOH;"
strPrinters = strPrinters & "\\srvr-print1\F3_SALES_LJ5500;"
strPrinters = strPrinters & "\\srvr-print1\PDF995Share;"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Worker Section
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' This section does the actual work of mapping printers
Set WshNetwork = CreateObject("WScript.Network")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
strPrinters = Left(strPrinters,Len(strPrinters)-1)
For Each objOS in colOSes
strOsVersion = Split(objOS.Version,".")
Next
If strOsVersion(o) > 4 Then
If strOsVersion(1) > 0 Then
' This is a Windows XP workstation or newer, do the script
' Query WMI for a list of the printers on this workstation
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer WHERE Network = TRUE")
' Determine if the default printer is a network printer
For Each objPrinter in colInstalledPrinters
If objPrinter.Default = True Then
strDefaultPrinterNetworkUnc = objPrinter.Name
End If
Next
' Delete network printers from workstation
For Each objPrinter in colInstalledPrinters
WshNetwork.RemovePrinterConnection objPrinter.Name
Next
' Map network printers to workstation
strPrinters = Split(strPrinters,";")
For i = 0 To UBound(strPrinters)
If strPrinters(i) <> "" Then
WshNetwork.AddWindowsPrinterConnection strPrinters(i)
End If
Next
' If old default printer was network printer, reset it as default
If Len(strDefaultPrinterNetworkUnc) > 0 Then
WshNetwork.SetDefaultPrinter strDefaultPrinterNetworkUnc
End If
Else
' This is a Windows 2000 workstaion, do nothing
End If
End If
|