Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
win_domain_user: add retry logic for null user principal group #54334
Active Directory Principal Group could be read null when created while AD global catalogue is replicated. This patch adds retry logic to avoid raising a exception inside
Mar 26, 2019
I'm unsure as to why this fix is needed, sorry I'm not too familiar with these cmdlets. Are you creating that principal before the
@jborean93 It all happens when creating a new user, it automatically gets "Domain user" group as principal.
New-ADUser -Name $username Get-ADPrincipalGroupMembership $username
When I use
Ok that makes sense, before I review the actual code are you able to align it to be like the rest of the module style, this would be things like;
I'm not sure if it is possible but it would be a lot better if we could use some event watcher or notification service for when the principal group member is set for the user object. Having arbitrary sleeps are not the best practice and it's not something I usually feel comfortable with.
It will need:
Other possible approach is returning
@jborean93, what path seems better for you?