How can I use the result of a dsquery user-statement in a variable in
dos-batchfile?
I'd like to read the DN of an AD-User by passing
dsquery user
OU=User,OU=SF_D,OU=Accounts,DC=Domain,DC=company,DC=blablabla -samid
qx64209
and use the result
"CN=Dimo
Tabken,OU=User,OU=SF_D,OU=Accounts,DC=Domain,DC=company,DC=blablabla"
as a variable called UserDN.
Unfortunately I don't have an idea how to do this ...
set UserDN=dsquery user
OU=User,OU=SF_D,OU=Accounts,DC=Domain,DC=company,DC=blablabla -samid
qx64209
would probably work in VB / VBA ... but it doesn't in my batchfile ...
This is probably an easy question for most of you ;-)
Thanks for your help!
Dimo
Well, I can't test it because I haven't switched to AD yet but this should
give you something to try. Obviously, you need to use the whole dsquery
command between the parens.
For /f "tokens=*" %%a in ('dsquery user...') do set UserDN=%%a
HTH
Matt
--
Posted via a free Usenet account from http://www.teranews.com