tjbradford
Technical User
The problem i'm having is i can't seem to pass the -pwd entry correctly.
I have tried % and %% and %! to make the field appear as a variable but with not joy, however if i place %SOME% in it with the var i made above it works, I think it's todo with the qty of % in this field and the next one e.g. %%n but I have no idea on how to wrap it so it's read correctly as a variable.
anyone able to assist me in this cockup ?
heres the code \/
@echo on
setlocal enableDelayedExpansion
SET SOME=123456
SET SOME[1]=Timing
SET SOME[2]=Table
SET SOME[3]=Carrot
SET SOME[4]=Flight
SET SOME[5]=Honey
SET SOME[6]=Bunny
SET SOME[7]=Magic
SET SOME[8]=Beans
SET SOME[9]=Field
SET SOME[10]=Clock
SET SOME[11]=Highway
FOR /L %%i IN (1,1,2) DO (
set /a rand=!random!%%5+1
set /a countit=!random!*100/32768+1
set dsrunner=dsmod CN=Supply%%i,OU=%%i,OU=Staff,OU=CSE,DC=WCS,DC=INTERNAL
for %%N in (!rand!) do dsmod user "CN=Supply%%i,OU=Supply,OU=Staff,OU=CSE,DC=WCS,DC=INTERNAL" -pwd %SOME[%n]%
echo
)
/end
I have tried % and %% and %! to make the field appear as a variable but with not joy, however if i place %SOME% in it with the var i made above it works, I think it's todo with the qty of % in this field and the next one e.g. %%n but I have no idea on how to wrap it so it's read correctly as a variable.
anyone able to assist me in this cockup ?
heres the code \/
@echo on
setlocal enableDelayedExpansion
SET SOME=123456
SET SOME[1]=Timing
SET SOME[2]=Table
SET SOME[3]=Carrot
SET SOME[4]=Flight
SET SOME[5]=Honey
SET SOME[6]=Bunny
SET SOME[7]=Magic
SET SOME[8]=Beans
SET SOME[9]=Field
SET SOME[10]=Clock
SET SOME[11]=Highway
FOR /L %%i IN (1,1,2) DO (
set /a rand=!random!%%5+1
set /a countit=!random!*100/32768+1
set dsrunner=dsmod CN=Supply%%i,OU=%%i,OU=Staff,OU=CSE,DC=WCS,DC=INTERNAL
for %%N in (!rand!) do dsmod user "CN=Supply%%i,OU=Supply,OU=Staff,OU=CSE,DC=WCS,DC=INTERNAL" -pwd %SOME[%n]%
echo
)
/end