title: Export to Database or CSV Expired
body: <p>I need a help to export the script below direct to database or to csv . I dont wanna much about script and I need help pls. I need to know which users inside a group will expire the password and date , the script works good but I cannot found a way to export.</p>
  <p>The script is</p>
  <pre><code>$users = Get-ADGroupMember &quot;GROUPNAME&quot;
  foreach ($user in $users) {
      Get-ADUser -Filter { Name -eq $user.name } -Properties &quot;DisplayName&quot;, &quot;msDS-UserPasswordExpiryTimeComputed&quot; | 
      Select-Object -Property &quot;Displayname&quot;, @{Name = &quot;ExpiryDate&quot;; Expression = { [datetime]::FromFileTime($_.&quot;msDS-UserPasswordExpiryTimeComputed&quot;) } }
  }
  </code></pre>