A. Why aren't you using AD to create the home directories? When you specify the home dir \\server\Users\%USERNAME% as the home path when you create the user, it will be created with the correct permissions AND mapped automatically without any scripting.

B. If you have more than one DC and the home folders aren't replicated between them, mapping to @LSERVER\Students$\%USERNAME% may have a 50-50 chance of working, less if you have more than two DCs.

C. InGroup() assumes the current domain - no need to specify it.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D