Azure AD sync information in Powershell/Event Viewer

Jan.Sebek 0 Reputation points
2023-04-07T08:36:39.7+00:00

Hello Community When you search for "Access Work or School" in windows start menu you get list of all AzureAD links tied to account, clicking on entry in list shows Info button under which you can find bunch of information like enforced policies, timedate of last sync and button to enforce the sync now. I wonder if I can display that information in powershell console. Additional question would be: where I can find events like syncing with Azure Directory in Event Viewer.

https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/azure-ad-sync-information-in-powershellevent/3af3f6d4-958f-462a-b78a-7f6db228a99a

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,195 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
601 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,329 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,629 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 36,411 Reputation points Microsoft Employee
    2023-04-09T16:57:33.5533333+00:00

    Hi @Jan.Sebek ,

    To get information about the last sync time of a user via Powershell, you can use the Get-MsolUser command.

    (Get-MsolUser -UserPrincipalName ‘drscripto@contoso.com’).LastDirSyncTime
    

    https://learn.microsoft.com/en-us/powershell/module/msonline/get-msolgroup?view=azureadps-1.0

    You can use Get-EventLog to view the events on a local computer.

    To view applied Conditional Access policies, you can use Get-MgAuditLogSignIn or check the Azure AD sign-in logs. https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/how-to-view-applied-conditional-access-policies

    To view activity logs, you can use the Microsoft Graph API.

    https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/howto-access-activity-logs

    Let me know if this is what you are looking for and if you have further questions.

    If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar information.

    0 comments No comments