Ok as a test I removed the comments for that script to run.

code:
Break ON
; uncomment the next line to step through the code
; DEBUG ON
; Example of LDAP call. GetObject("LDAP://ou=Users,ou=YourBusinessUnit,dc=YourCompany,dc=com")
; You need to know your LDAP connection. You can maybe find it by checking the propery details on the OU for your users.
$target = GetObject("LDAP://OU=Test,OU=Information Systems,OU=AdminBldg,DC=sussexcounty,DC=net")
? 'Error = '+@ERROR+' - '+@SERROR
$loginscript="logon.bat"
For Each $user in $target
If $user.loginscript <> $loginscript
? "Current Script for " +$user.name " is: " +$user.loginscript+ " Should be: " +$loginscript
$user.loginscript=$loginscript ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat.
? 'Error = '+@ERROR+' - '+@SERROR
$user.SetInfo ; Remove the semi-colon at the front of this line to enable actually resetting the logon bat.
? 'Error = '+@ERROR+' - '+@SERROR
? "Changed current Script for " +$user.name " to: " +$user.loginscript
EndIf
Next

I have it going to the Test OU in which there are 2 users, currently that have no logon script setup. If I run this with the comments removed are you saying it will automatically assign the logon.bat to those 2 user's profile?