1.

Solve : logon.bat help - resources if in specific groups?

Answer»

Hello again!

I am working on a logon script and having a bit of trouble. I am looking to install printers and maps specific drive according the an OU the signing on user is in.

So this is an example.
If the user is in the OU called "ACCOUNTING" i want to have the printers called "aact1", "acct2" installed. also i would like to map the drive letter "z" to "\\server1\share1".

I know the commands to map a drive and printer i am just having issues with the if statement with the OU.

Printer CODE
Code: [Select]REM installs printer
RunDll32.EXE printui.dll,PrintUIEntry /in /n \\server\printername2

REM To set DEFAULT Printer
rem RunDll32.EXE printui.dll,PrintUIEntry /y /n \\server\printername2

mapped drives Code: [Select]REM MAP H: To Users
NET USE H: \\server\share


Thank you for your help!Is it blatting about credentials missing? What is your error message?

The NET USE without {user/password} MAKES me believe your having authentication issues possibly with your instructions.Well the commands i am using are working. I would just like to add some "if" commands so i can only apply the printers i want to use to a user in specific OU in AD. Same with the mapped drives. I am just very fuzzy when it comes to using the if statement in this setting.I'm not sure what OU is, or how to use it, but this could work (modify OU to what you want).

if /i "OU"=="accounting" (
your commands here
don't remove the brackets!
)Thank you for the section of section of code. I will see if that will work ith what i am trying to do.

Active Directory Organizational Units can be explained here -> http://technet.microsoft.com/en-us/library/cc758565(WS.10).aspx



Discussion

No Comment Found