Jump to content

Recommended Posts

Posted

Hello all...Back again

 

I want to add a printer for the domain users................

................................................................................

Server 2008 R2

 

Workstations are XP SP3

 

 

Server name is Server1

 

Shared printer is Room 8 Printer

.....................................................................................

Tried GPO...........nothing

I have set up the pupils policy to include the printer

Tried Kixtart......... nothing:o

 

Anybody got a kix script that works...Ta John

Posted

this should work, its a vbs i run here, i dont tend to use the user bit, but its there for me when i do

 

 Dim objNetwork, objPrinters, objSysInfo, strComputerDN, strUserName
Dim strUserDN, objUser, strGroups, objGroup, strUserDomain
On Error Resume Next
Set objNetwork = CreateObject("WScript.Network")
Set objPrinters = objNetwork.EnumPrinterConnections
strUserName = objNetwork.UserName
strUserDomain = objNetwork.UserDomain
Set objSysInfo = CreateObject("ADSystemInfo")
strComputerDN = objSysInfo.ComputerName
'remove if no individual needs a set printer
strUserDN = objSysInfo.UserName
Set objUser = GetObject("WinNT://" & strUserDomain & "/" & strUserName & ",user")
strGroups = ""
For Each objGroup In objUser.Groups
  strGroups = strGroups & ", " & objGroup.name & ","
Next
Set objUser = Nothing
'stop here

If InStr(LCase(strUserName), LCase("")) Then
  objNetwork.AddWindowsPrinterConnection "\\server\"
  objNetwork.SetDefaultPrinter "\\server\"
End IF

 

if you want it to remove all other printers and just put the ones above in, should leave local ones alone

add

 

For LOOP_COUNTER = 0 To objPrinters.Count - 1 Step 2
     If Left(objPrinters.Item(LOOP_COUNTER + 1), 2) = "\\" Then
     objNetwork.RemovePrinterConnection objPrinters.Item(LOOP_COUNTER + 1), True, True
     End If
 Next

If InStr(LCase(strUserName), LCase("")) Then
----> "add cond above here"
  objNetwork.AddWindowsPrinterConnection [url="file://\\server\"]\\server\[/url]

  • Thanks 1
Posted

Try Group Policy Preferences - that is honestly the best way to go. I have migrated away from most of my scripts.

 

What is your error log saying when you try to map the printer?

Posted

I think digone is right, I just did this the other day. I have S2008R2 x64 and an x86 Win7 workstation. I couldn't get the printers to deploy by computer using gpo. The problem was no x86 driver. Try adding the printer manually first off.

 

I tried to add the x86 drivers on their own but it didn't recognise them. The included drivers with windows don't necessarily match the x86 version you download. I had to download the x64 version from HP (in our case) replace the standard driver and then download the identical x86 driver and finally it would add :)

 

A little messy but so easy to deploy using print manager and gpo. Any questions let me know, I am spending the summer doing this and learning as I go!

  • Thanks 1
Posted

Tried using "Preferences" on the Domain Policy to add the printer but as it is XP workstations they need to have a couple of additional files installed for the preferences to work:eek: I didnt know that until tday.

So I will give it another go tomorrow

 

Another thing is ...I dont think the server is set up as a print server:eek:

 

Dont know if that makes any difference...

 

Need to go on a course me thinks:(

 

Ta John

Posted
As long as the printer is shared it will work, you could share a printer on a workstation and deploy that with group policy preferences if you wish. The printer server role just gives you a nice mmc snap-in and an alternate (less flexible) method to deploy printers with GPOs rather than use Group Policy Preferences. Personally I don't bother with the print server role.
  • Thanks 1
Posted
Tried using "Preferences" on the Domain Policy to add the printer but as it is XP workstations they need to have a couple of additional files installed for the preferences to work:eek: I didnt know that until tday.

So I will give it another go tomorrow

 

Another thing is ...I dont think the server is set up as a print server:eek:

 

Dont know if that makes any difference...

 

Need to go on a course me thinks:(

 

Ta John

 

You will need Client Side Extensions installed on the machines. You can script this with a software install GPO, or you can enable it in WSUS. Either way will work fine.

  • Thanks 1
Posted

Because I have not setup the default domain printer :eek:yet...

 

If the pupils want to use a printer they have to do it the long way by "Add Printer" \\server1\ etc etc

 

I have discovered that there is not as much printing waste as there was before. I can only assume that this is because the lazy pupils (who usually print rubbish) cannot be bothered to add a printer.

 

Since the problem there is hardly any waste at all......

 

:)

Posted
You will need Client Side Extensions installed on the machines. You can script this with a software install GPO, or you can enable it in WSUS. Either way will work fine.

 

This sounds too good to be true. I will give it a go

 

Ta John

Posted

I used the vbs script from alunmjones and it worked. I added a welcome message at the beginning of the script to check it was the vbs script and not a client side extension that was doing the deed.

 

Dead chuffed it worked:rolleyes:

 

Thanks everyone

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...