DSQUERY | DSMOD

M

mike

I'm attempting to determine how useful these commands really are and limited
they are. After an in-place upgrade of a domain to w2k3 it didn't populate
the UPN values. I'm attemping to use these commands to grab the current
samid and make it (e-mail address removed) for about 1000 users.

I can't figure it out. I don't think these commands actually allow me to
pipe the samid query into the dsmod and change the upn. May write these
commands off as semi useful and write a vbscript. Anyone know if you can do
this?

Thanks
 
J

Jerold Schulman

I'm attempting to determine how useful these commands really are and limited
they are. After an in-place upgrade of a domain to w2k3 it didn't populate
the UPN values. I'm attemping to use these commands to grab the current
samid and make it (e-mail address removed) for about 1000 users.

I can't figure it out. I don't think these commands actually allow me to
pipe the samid query into the dsmod and change the upn. May write these
commands off as semi useful and write a vbscript. Anyone know if you can do
this?

Thanks

I find them very useful.

Using ForestRootDomain from tip 7680 in the 'Tips & Tricks' at
http://www.jsiinc.com

@echo off
setlocal
call ForestRootDomain Domain
for /f "Tokens=*" %%d in ('dsquery user -o dn -name * -limit 99999') do (
for /f "Tokens=*" %%s in ('dsquery user -o samid %%d') do (
set samid=%%s
set dn=%%d
call :setupn
)
)
endlocal
goto :EOF
:setupn
set samid=%samid:"=%
set upn=%samid%@%Domain%
dsmod user %dn% -upn %upn%


Also, see tip 7325 for another example.



Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
J

Jerold Schulman

I'm attempting to determine how useful these commands really are and limited
they are. After an in-place upgrade of a domain to w2k3 it didn't populate
the UPN values. I'm attemping to use these commands to grab the current
samid and make it (e-mail address removed) for about 1000 users.

I can't figure it out. I don't think these commands actually allow me to
pipe the samid query into the dsmod and change the upn. May write these
commands off as semi useful and write a vbscript. Anyone know if you can do
this?

Thanks


See tip 7685 in the 'Tips & Tricks' at http://www.jsiinc.com


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
D

David Wang [Msft]

scripting is the glue to connect commands together (note the replies from
Jerold).

The FOR command is absolutely invaluable to "parse and pray" output from one
command into input for another.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
I'm attempting to determine how useful these commands really are and limited
they are. After an in-place upgrade of a domain to w2k3 it didn't populate
the UPN values. I'm attemping to use these commands to grab the current
samid and make it (e-mail address removed) for about 1000 users.

I can't figure it out. I don't think these commands actually allow me to
pipe the samid query into the dsmod and change the upn. May write these
commands off as semi useful and write a vbscript. Anyone know if you can do
this?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top