title: Would like to get last signin for guest account in azure AD for last 30 days
body: <p>I have a very specific question in regards Signin options in Azure active directory . I see that within signin options you get all the details about users who have logged in . i want to get details only about guest users who have logged in last 30 days and their last signin .</p>
  <p>How can i get that ? is their any powershell script that i can execute</p>
  <p>i found this blog <a href="https://devblogs.microsoft.com/premier-developer/azure-active-directory-automating-guest-user-management/" rel="nofollow noreferrer">https://devblogs.microsoft.com/premier-developer/azure-active-directory-automating-guest-user-management/</a></p>
  <p>#Get all the Guest Users
  $guestusers=Get-AzureADUser -Filter &quot;UserType eq 'Guest' and AccountEnabled eq true&quot;
  $guestusers.displayname</p>
  <p>I am not sure as to how should we proceed from below and how can i get the displayname for the users who logged in last 30 days .</p>
  <p>Can somebody help me with the below commands that i need to execute ?</p>
  <h1>For each Guest user, validate there is a login in the last week</h1>
  <p>foreach ($guestUser in $guestUsers) {
  Write-Output &quot;Getting User's logins for the last week&quot;
  $guestUserSignIns = Get-AzureADAuditSignInLogs -Filter &quot;UserID eq '$($guestUser.ObjectID)' and createdDateTime ge $queryStartDateTimeFilter&quot;</p>