I seem to be having a lot of trouble with something I thought would be relatively easy. I am trying to use a list of users. I am having two issues:
1. I can run the command on the user from the CLI, however, as soon as I integrate the for /f it doesn't recognise the input.
2. I am yet to get this working with a user with a FQDN with a space in their CN
This is the code I have so far:
for /f %%a in ("%Users%") do (
dsmod user "CN=%%a,CN=Users,DC=roads,DC=vic,DC=gov,DC=au" -office testoffice
) >>dsmod.log 2>&1
This is the error output I am getting:
C:\temp>(dsmod user "CN=c:\temp\users.txt,CN=Users,DC=roads,DC=vic,DC=gov,DC=au" -office testoffice )
dsmod failed:Value for `Target object for this command' has incorrect format.
type dsmod /? for help."c:\temp\users.txt"
Hope someone can help.