Solved

Active Directory LOGIN script for ALL USERS on only SOME MACHINES

Posted on 2007-11-30
6
847 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Disable USB Access on Network Computers 6 69
network monitoring tools / software 5 138
Help logging in to my router 12 57
assignment of laptops - risks 6 48
Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
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…

856 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