Solved

If statement in batch file based on AD fields

Posted on 2011-03-18
2
379 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
[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
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

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

630 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