I'm using a combination of the built-in functions of Powershell and the Quest commandlets.
These are the steps I use:
Create the user using the QAD cmdlets
Modify the user account settings using the QAD cmdlets
Enable the account using the QAD cmdlets
Create the user directory structure
Assign permissions to the directories using the Set-ACL cmdlet
Stepping through the commands in PowerGUI, the commands work perfectly. But, when I run them full-speed outside of the editor, they work intermittently. Sometimes the account would get created, sometimes it wouldn't, sometimes the permissions on the folder were set properly, sometimes they weren't.
So, I narrowed it down to a problem with the script being unable to locate the network account. I researched it a little and inserted the Connect-QADService command to always connect to the PDC of the domain. That helped with the creation and editing of the accounts, those work every time now.
I'm still stuck with the issue of the Set-ACL cmdlet being unable to reference the proper account though, and it makes the setting of the folder permissions crash. It still works if I step through the programs slowly though, so I know it's a timing issue.
What is the best approach to resolving this?