admodcmd batch script help

Jan 12, 2011 at 3:37 PM

Hello,

  I am trying to create a batch file for use to bulk scripting but am running into issues with getting it to work properly.

 1. admodcmd -dn " OU = Users, OU=MyOU,DC=domain,DC=com " -s -custom userPrincipalName %'sAMAccountName'%@domain.com

When upn.bat is run, it set the upn field new value in AD to “@domain.com".

 2. admodcmd -dn "OU = Users, OU=MyOU,DC=domain,DC=com " -s –custom displayName "%'sn'%, %'givenName'%"

When run name.bat, it sets the display name new value in AD to “ , “.

It is strange as if I open cmd.exe, copy and paste the exact line it work perfectly.

 Help?

Thanks