Hold on... Have you ever tried to modify 7,000+ accounts through the GUI ? Give it a try some time. About 30 minutes later when it comes back... You should be done.

This ADSI script runs through in about 1 minute. Oh, and try to scroll through 7,000+ accounts and pick out the ones you don't want to change. I think you will agree that this script is 100% faster and easier. This code can also probably be modified to change most other User Manager settings as well.

Yes, I did leave out an ENDIF I put in another line for logging. Then decided I did not really need it.

This should work ok.

code:

$target = @domain
$target = getobject("WinNT://$target")
$loginscript = "LOGON.BAT"
if @error <> 0
exit(1)
endif
for each $user in $target
if $user.class = "USER"
if $user.loginscript <> "$loginscript" AND substr($user.name,1,1) <> "$$" AND substr($user.name,1,1) <> "#" AND substr($user.name,1,3) <> "SMS"
shell '%comspec% /c echo "' + $user.name + ' ' + $user.loginscript + '" >>c:\temp\beforelogons.txt'
$user.put("loginscript",$loginscript)
$user.setinfo
if $user.loginscript <> "$loginscript"
shell '%comspec% /c echo "' + $user.name + ' ' + $user.loginscript + '" >>c:\temp\afterlogons.txt'
endif
endif
endif
next