Solved

Active Directory LOGIN script for ALL USERS on only SOME MACHINES

Posted on 2007-11-30
6
845 Views
Last Modified: 2010-10-05
I am trying to figure out how to run a small script to add a printer when ANY user logs into ONLY LAB computers. The script works if I apply the group policy to all users but it adds the printer to every computer on the network. If I try to restrict by computer or group the script doesn't run. Any ideas?
0
Comment
Question by:ocacadmin
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
2PiFL earned 250 total points
ID: 20386424
Create an OU for the lab computers, move the lab computers to this OU and apply the GPO to this OU.
0
 
LVL 4

Expert Comment

by:mdefalco
ID: 20386428
You should have the IP addresses of those computers and then you can add them to your script.

First go to this webpage, it will show you how to get the ip address of the machine you are logging into;

http://www.codeproject.com/vbscript/ipaddress.asp

This creates a variable called GetIPAddress, you can now use this in your code. How many computers are in that lab, and are their ips static, if not you should set them to static, or give them a dhcp reservation.

You can now comare the ips in the lab to the current loggen in user ip and tell it to install only on the machines that do not fit this ip.

If they are in a different subnet all together, then you can set them up in AD as a seperate subnet and then add that subnet to the GP, alone. I have done this before but a long time ago, if you need it this way I can help you with that.
0
 

Author Comment

by:ocacadmin
ID: 20399921
I figured out a better solution to my problem:

The reason I was trying to do this is because I thought I could not add printers at the machine level rather than just added printers to user profiles.

You can in fact add printers to Machines, but only at the command line like so:

rundll32 printui.dll,PrintUIEntry /ga /q /n\\server.name\printer-name

The ga switch adds a "per machine printer" that is available to every user that can login to the machine.

After that it just a matter of adding this line to a startup script either through Active Directory or some other means.


rundll32 printui.dll,PrintUIEntry /ga /q /n\\server.name\printer-name

Open in new window

0
 
LVL 4

Expert Comment

by:mdefalco
ID: 20399948
Very cool, thanks for posting that. I think I may have a use for it too,

~ Jim
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Wildcard Certificate means all of your sub-domains will resolve to the same location, regardless of the non-SSL Document-Root specification. A user will need to purchase a wildcard SSL from a vendor or a reseller that supplies them. Similar to ha…
This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now