I want to edit a large number of users' title field on Active Directory that I have listed in a CSV file.
I can get every attribute associated with a user if I run this:
dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(sAMAccountName=%UsrFld%))" -attr * -limit 0
However, if I attempt to do the following to edit the "title" field, using this:
dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(sAMAccountName=%promptusername%))" -attr * -limit 0| dsmod user -title Disabled User
I get the following error:
dsmod failed:Value for 'Target object for this command' has incorrect format.
Now obviously DSMOD is telling me that that it can't interpret the first half of my syntax as an object to edit. My question is, how do I edit the title field with the query I'm using?
Thanks in advance!