header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Timing issue with creating accounts...
Last Post 28 Jul 2009 09:16 AM by Dan Ball. 3 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Dan BallUser is Offline
Basic Member
Basic Member
Posts:154
Avatar

--
26 Jul 2009 04:17 PM

    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? 

    PoshoholicUser is Offline
    PowerShell MVP, Community Director
    Basic Member
    Basic Member
    Posts:111
    Avatar

    --
    26 Jul 2009 09:19 PM
    Set the ACL using the SID instead of the account name. That way it won't have to be looked up. See this thread for more details:

    http://www.powergui.org/thread.jspa...geID=30161
    Kirk Munro [MVP]
    Poshoholic

    My blog: http://poshoholic.com
    Follow me on Twitter: http://twitter.com/poshoholic
    Dan BallUser is Offline
    Basic Member
    Basic Member
    Posts:154
    Avatar

    --
    27 Jul 2009 08:15 AM
    Cool! I didn't know any of the QAD commands returned anything, there isn't anything in the documentation about that. I'll give that a try in a little bit to see how it works.
    Dan BallUser is Offline
    Basic Member
    Basic Member
    Posts:154
    Avatar

    --
    28 Jul 2009 09:16 AM
    Yep, that seems to have done the trick, thanks!
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer