Link to home
Start Free TrialLog in
Avatar of cbielich
cbielichFlag for United States of America

asked on

If statement in batch file based on AD fields

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.
Avatar of crazyn3wf
crazyn3wf
Flag of Canada image

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
ASKER CERTIFIED SOLUTION
Avatar of crazyn3wf
crazyn3wf
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial