Skip to content

Instantly share code, notes, and snippets.

@tostka
Created July 17, 2019 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tostka/2b11f73c97bbe66ac88ef0ad010f4e80 to your computer and use it in GitHub Desktop.
Save tostka/2b11f73c97bbe66ac88ef0ad010f4e80 to your computer and use it in GitHub Desktop.
Wait for AD object to replicate to AzureAD
# AAD replication dawdle loop:
# 1-line, note, the get-msoluser cmdlet lacks an erroraction param, which causes it to error every pass. But the code plows on until object is returned replicated
Do { write-host "." -NoNewLine; $msolu = get-MsolUser -UserPrincipalName $adu.userprincipalname ; start-sleep -s 30 ; } Until($msolu) ; write-host "`a" ; write-host "`a" ; write-host "`a" ; $msolu | format-list userprin*, *Error*, *status*, softdel*, lic*, islic* ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment