Solved

If statement in batch file based on AD fields

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

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

713 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