Hello, I got past the AzureAD error
But now I am getting this error
Get-AzureADAuditSignInLogs : Error occurred while executing GetAuditSignInLogs
Code: UnknownError
Message: Too Many Requests
InnerError:
RequestId: 224647ce-a92e-46c4-b20a-525835e42c82
DateTimeStamp: Tue, 01 Nov 2022 19:41:14 GMT
HttpStatusCode: 429
HttpStatusDescription:
My script looks like this (am I doing something wrong)?
$file = Import-Csv -Path "TEST-UPN-LIST.csv" -delimiter ","
foreach ($user in $file) {
Get-AzureADAuditSignInLogs -Filter "UserPrincipalName eq '$User'" -Top 1 | `Export-csv -path .\Test.csv -Append -Encoding UTF8
select CreatedDateTime, UserPrincipalName, IsInteractive, AppDisplayName, IpAddress, TokenIssuerType, @{Name = 'DeviceOS'; Expression = {$_.DeviceDetail.OperatingSystem}}
}
Does this look right? Why would I be getting too many requests?
Is there any way around this?