Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Active Directory LOGIN script for ALL USERS on only SOME MACHINES

Posted on 2007-11-30
6
Medium Priority
?
852 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
2PiFL earned 1000 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

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

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

How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

610 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