Solved

If statement in batch file based on AD fields

Posted on 2011-03-18
2
372 Views
Last Modified: 2012-05-11
My question is I wanted to know if there was a possiblity to have a Bat file run some kind of if/elseif statement that can determine a users location on a Active Directory server to run customer printer install commands. For Instance

lets say I have a normal bat file users have when they login to the AD network. In there I usually have some printer install commands like "rundll32 printui.dll,PrintUIEntry /in /q /n \\printserve\RicohSchoolCopier". Now I am consolidating all the scripts into one for the purpose of uniformity on network shares BUT not everyone needs all the printers all over the network so......my idea is some kind of statement based on maybe a persons OU or a Department in the Users and Computers area of AD. Hope that makes sense.
0
Comment
Question by:cbielich
  • 2
2 Comments
 
LVL 1

Expert Comment

by:crazyn3wf
ID: 35167492
Not sure why you would want to write a Bat Script to do this when its much easier to do in GPP

Check out the Doc at the link below

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=42e30e3f-6f01-4610-9d6e-f6e0fb7a0790
0
 
LVL 1

Accepted Solution

by:
crazyn3wf earned 500 total points
ID: 35167501
Sorry GPP is Group Policy Preferences
0

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ADMT Intra Forest migration questions 7 78
active directory 17 36
how to get the largest file size? 33 44
Secondary DC 3 17
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Introduction You may have a need to setup a group of users to allow local administrative access on workstations.  In a domain environment this can easily be achieved with Restricted Groups and Group Policies. This article will demonstrate how to…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

759 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

18 Experts available now in Live!

Get 1:1 Help Now