I'm also trying to create a profile folder if it doesn't exist but the problem is the client has divided the profile paths up in locations.
So userA's profile path is \\servername\profiles\officeA\userA
and userB's profile path is \\servername\profiles\officeB\userB
I'm tying to think of the best way to get the $Profile to default to the right office for the user.
So far I have this but need to add the office loaction in.

$Profile = ("\\" + $FileServ + "\Profiles\" + @userid)

if not exist($Profile)
md $Profile
shell "%comspec% /c echo y| cacls $Profile /t /c /g @ldomain\@userid:c"
shell '%comspec% /c echo y| cacls $Profile /t /e /c /g "@ldomain\domain admins:f"'
else
endif


Edited by BarryWhite (2006-01-06 09:21 PM)