title: Getting the get-aduser Whenchanged property in to variable for log in script
body: <p>I have the following bit of code </p>
  
  <pre><code>$date = ((get-date).addmonths(-3))
  Get-ADUser -Filter * -Properties whenChanged| Where-Object {$_.whenChanged -ge $date} | select name
  </code></pre>
  
  <p>This works fine and gives me a nice list of users that have not had there account updated in 3 months. But I need this as a log in script so I want it to say logicaly </p>
  
  <pre><code>if ((get-aduser &lt;name&gt; -Properties whenChanged) -ge $date) {do something} else {do nothing} 
  </code></pre>
  
  <p>When ever I try this i get.. </p>
  
  <pre><code> $c = Get-ADUser street | Where-Object {$_.whenChanged -ge $date} | select whenchanged
  write-host $c
  @{whenchanged=07/09/2015 17:00:30}
  </code></pre>
  
  <p>I know there is a magic bit of syntax to make it work and I would be great ful for any pointers. </p>