Forum Discussion
List all users' last login date
Staniko
Thank you for the above, looks exactly what I need but am getting the following error when running an elevated ISE PowerShell window:
Get-AzureAdAuditSigninLogs : The term 'Get-AzureAdAuditSigninLogs' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:9 char:18
+ $LoginTime = Get-AzureAdAuditSigninLogs -top 1 -filter "userprinc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzureAdAuditSigninLogs:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Any ideas? 🙂
jjdmsgc Did the module install correctly? Did you run Powershell as admin? What does the command
Install-Module AzureADPreview -AllowClobber -Force
return?
- jjdmsgcAug 12, 2021Copper ContributorRan and installed fine, then signed in with a global admin account for the tenancy I want to run it on and script fails on that line.
When I remove that line it runs and exports the information minus the login info etc. so problem is local to that line! 😞 Thank you for the swift reply.