It happens here:

$DN = TranslateName (1, @LDomain, 3, @LDOMAIN + "\" + @USERID, 1)
? "Server Error: " + @SERROR

I am using TranslateName() 2.0