title: Cannot find an overload for "op_Subtraction" and the argument count: "2"
body: <p>I am trying to write a Powershell script that identifies users who haven't logged in for 90 days, but I keep getting this error message:</p>
  
  <p>Cannot find an overload for "op_Subtraction" and the argument count: "2".  At first I thought it was a variable type mismatch but looking at the variables for subtraction it looks fine.</p>
  
  <pre><code>PS C:\&gt; $today.GetType()
  
  IsPublic IsSerial Name                                     BaseType
  -------- -------- ----                                     --------
  True     True     DateTime                                 System.ValueType
  
  PS C:\&gt; $users[198].LastLogonDate.GetType()
  
  IsPublic IsSerial Name                                     BaseType
  -------- -------- ----                                     --------
  True     True     DateTime                                 System.ValueType
  </code></pre>
  
  <hr>
  
  <pre><code>$today = Get-Date
  $days = 90
  $users = Get-ADUser -Properties * -Filter *
  foreach ($i in $users) 
  {
      $difference = $today - $i.LastLogonDate
      #Write-Host $i.Name + $difference.Days
      if ($difference.Days -ge $days){Write-Host $i.name " hasn't logged on in 90 days"}
      elseif ($i.LastLogonDate -eq $null) {Write-Host $i.name " has null value"}
      else {Write-Host " No Value"}
  }
  </code></pre>
  
  <p>Thoughts??</p>
  
  <p>Thanks!!</p>