Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Can printer script be applied to a Computer in Group Policy?


Recommended Posts

Posted

Hi guys,

 

I'm sure this is simple.

 

I have a .vbs script that basically just sets the default printer to be "ITSuiteLaser". I want it to run on all computers in the Devices/ITSuite OU so that then whenever anybody logs onto the computers in the IT Suite, regardless of their username (y1 -y6, teacher) the default printer is the Laser in the IT Suite.

 

I have created a new GPO called 'Default Printer' which is applied to the IT Suite OU. In it the only setting is a logon script - itsuiteprinter.vbs. This policy is supposed to apply to both IT Suite OU and the ITSuitePCs group. Secuirty settings seem fine (apply group policy and read are both ticked), but it doesn't run!

 

I have tried using the GPMC modelling tool, and it shows that the policies applied are - Default Domain Policy and 'Default Printer'.

 

So why is it not running?

 

I have tried gpupdate /force and rebooted the PC but it makes no difference..

 

Please help!

 

Thanks :D

Posted

You need to enable loopback processing so that user GPO settings can be applied to computer OUs.

 

Look under

 

Computer Configuration/Administrative Templates/System/Group Policy/User Group Policy loopback processing mode

 

Enable and set to merge.

Posted
Loopback can be tempramental tho' - others here have had no problems, but i've had loads. Better IMHO to do it via scripting instead.
Posted
It is for any User based setting and you need to apply to a machine OU
Posted
Is there another group policy at the domain level which is taking precedence before the ITsuite OU and have you checked the order in which these have been applied to the actual ITsuite OU. Not trying to teach granny to suck eggs but just tryin to help. Loopbacks tend to be last resort so i would stay clear if you can help it as it will come and bite yer on the ar-e when you least expect it OK :)
Posted
Why do people use loopback processing for logon scripts where there's the "run these programs at logon" option in computer management->admin templates -> system -> logon?
Posted
Is there another group policy at the domain level which is taking precedence before the ITsuite OU and have you checked the order in which these have been applied to the actual ITsuite OU. Not trying to teach granny to suck eggs but just tryin to help. Loopbacks tend to be last resort so i would stay clear if you can help it as it will come and bite yer on the ar-e when you least expect it OK :)

 

I still need to learn to suck eggs! :p Any help is appreciated mate!

 

I'm not at the school today, but as far as I remember the order of precdence for GPOs that affect the ITsuite OU are:

 

Default Domain Policy,

Default Printer

 

Thats it.

 

Other policies such as Student LockDown, Proxy and Folder redirection are appliced to the Students OU.

Posted
Have a look in the scripts section for printer logon scripts that will add printers according to hostnames or what OU they are in. It's alot easier in the long run. Its also useful to have that bit of code to run in a startup script as well to get the printer drivers installed as a normal user wont be able to if an admin hasnt logged onto that machine etc.
Posted

After reading another thread on here about Microsoft Visualisation Server, I have downloaded it at home and setup two virtual PCs - one Server and one client. Its abit slow and lots of pagefile activity, but I can now try these suggestions at home!

 

Looking at the printer script now.

 

Thanks everyone!

Posted

Back at the school today, and even with loopback enabled it still didn't work.

 

I have just used Ric_'s excellent printer script and I have now achieved what I want so thanks! :D

 

However, I was wondering, if the PC is not called "ITSUITE" would it be possible to set the local printer using the USB001 port as the default instead?

 

This is becasue in classes we have loads of different printers, so setting the one using the USB001 port to default would be great, then when they are in the IT Suite and login the defult printer becomes the ITSuite laser.

 

As a side thing - I was at my local college checking something out recenlty and when a student/staff member logged in, a windows ballon tip appeared saying "You are connected to ****** Printer" and then disapeared. Thought that was pretty cool. It just makes it clear to the user, which printer they are able to print from. Is their an easy way to achieve this?

 

Thanks :D

Posted

Yup just use the msgbox function I use it to say default printer is .....

 

Dim MyVar

 

MyVar = MsgBox ("Hello World!", 0, "MsgBox Example")

 

Ben

Posted

A WSH example with a timeout:

 

Set oShell = CreateObject("WScript.Shell")

oShell.Popup "You are connected to Room IT1 Laser Printer", 5, "Information"

Posted

Using WSH just makes a msgbox appear and having the MyVar seems a waste to me because its not like you are returning anything into the variable ie if there was a yes , no and a cancel button then fair enough since you would need to check whether the end user pressed yes, no or cancel by using vbYes, vbNo or vbCancel ( which also has its numerical representations which Im not sure of off the top of my head )

 

ie

 

Dim MyResult

 

MyResult = MsgBox("Are you sure you want to quit?", 0, "End Program!")

 

If MyResult = vbYes Then

End

Else

EndIf

 

or something along those lines ( Not sure if that works in vbscript but you get the point )

 

Correct me if I am wrong ?

 

So from that I would say you could just do something like so :

 

MsgBox "Text you want here", 0,"Title for the msgbox"

 

That way you are not using a variable when you dont need it, you still get the info across to the user and you dont need to create an object to make it happen ( less coding ).

 

Just as effective ( I am sure it probably has its down sides and it would be nice to know what they are if there are any at all :)

 

I found an OCX on pscode.com that said it could be used in vbscript as well as visual basic, whether thats the case or not I dont know.

Posted
This is becasue in classes we have loads of different printers, so setting the one using the USB001 port to default would be great, then when they are in the IT Suite and login the defult printer becomes the ITSuite laser.

 

Yes just do:

 

Printer.SetDefaultPrinter "HP 1120C"

 

In the relevant case statement.

Posted

Just been through this thread (whilst assembly is on this morning :lol:)... lots of great tips here!

 

Thank You everyone.

Posted
A WSH example with a timeout:

 

Set oShell = CreateObject("WScript.Shell")

oShell.Popup "You are connected to Room IT1 Laser Printer", 5, "Information"

 

Just tried this and I get a normal MSGBOX, not a balloontip like they have at the college.

 

I have tried this on two PCs (one with ballontips disabled via GPO, and the other normal) and both just show the msgbox and not a balloontip.

 

Is there a way to have this message in a balloon tip? I have had a look on the internet and haven't really found anything useful.

 

Thanks

Posted

To get a balloontip which is easily missed anyway I think you need to have something running in the notification area to create it.

 

We just use a msgbox.

 

Ben

Posted

I think using vbscript to create a balloon is going to be a no goer, why not just use:

 

Set WshShell = CreateObject("WScript.Shell")

x = WshShell.Popup ("Default printer is 06laser01", 5, , 0 + 64)

 

That at least times out after 5 seconds and dissappears if they don't click on it.

 

Ben

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