I've looked over your script... and I've run out of time. I did a board search on JoinDomainOrWorkGroup and it pulled up a couple of threads which it appeared to be working. I did see Null was defined as "NULL" in one thread, and tried it but got the same error as you. Maybe they will give you some direction.