Paul

Hi, my name is Paul and I am a Sysadmin who enjoys working on various technologies from Microsoft, VMWare, Cisco and many others. Join me as I document my trials and tribulations of the daily grind of System Administration.

4 Comments

  1. Hi, great article!
    I am a bit of newbie in this but I am trying to build a script that gives me the login status for a series of users.

    I have tried this, but with no visible results:

    #Import the Azure AD Module
    Import-Module AzureADPreview

    #Connect to Azure AD
    Connect-AzureAD -AccountId [email protected]

    $CSVData = @(Import-CSV -Path AzureADBulkUserCreation.csv -ErrorAction Stop)
    Write-Verbose “Successfully imported entries from $FilePath”
    Write-Verbose “Total no. of entries in CSV are : $($CSVData.count)”

    Foreach ($Entry in $CSVData) {
    # Verify that mandatory properties are defined for each object
    $UserPrincipalName = $Entry.UserPrincipalName
    }

    foreach ($UserPrincipalName in $CSVData) {
    Get-AzureADAuditSignInLogs -Filter “UserPrincipalName eq ‘$UserPrincipalName'” -Top 1 | `
    select CreatedDateTime, UserPrincipalName, IsInteractive, AppDisplayName, IpAddress, TokenIssuerType, @{Name = ‘DeviceOS’; Expression = {$_.DeviceDetail.OperatingSystem}}
    }

    Any idea of what could be going wrong?

    • Please check if the users in the CSV file have any Sign in logs available in the last 30 days.
      I had the similar issue and realized that there were no Sign in logs for the users I tried in the last 30 days.

Leave a Reply

Your email address will not be published.