private/Get-O365SyncStatus.ps1
<#
.Synopsis This powershell cmdlet checks the sync status for Azure AD Connect and outputs a message indicating when the job is complete. .Description Lets user know when the Azure AD sync has completed .Example Get-O365SyncStatus #> Function Get-O365SyncStatus{ #Wait 10 seconds for the Sync to start Write-Host "Initializing Azure AD $SyncType Sync" -ForegroundColor Green Start-Sleep -Seconds 10 Write-Host "Status" -NoNewline -ForegroundColor Green #Display a progress indicator and hold up the rest of the script while the sync completes. While(Get-ADSyncConnectorRunStatus){ Write-Host "." -NoNewline -ForegroundColor Green Start-Sleep -Seconds 10 } Write-Host " Forced Azure AD $SyncType Sync has completed." -ForegroundColor Green } |