admodcmd batch script help

Jan 12, 2011 at 3:37 PM


  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'

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

 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.