Welcome to the board..

Commented out -
Code:

;BREAK ON
;CLS

;DEBUG OFF
;SetConsole("HIDE")



To see what is going on.

If you want to run this more cleanly, try using WKIX32.EXE.

Changed -
Code:

$ou.filter = $filter



To -
Code:

$ou.filter = $filter[0]



Why do you have -
Code:

IF Ucase($user.samaccountname) == UCase($strolduserid)



I changed this to -
Code:

IF Ucase($user.samaccountname) = UCase($strolduserid)



Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's