SaveText.Ru

Без имени
  1. $InactiveDays = New-TimeSpan -days 56
  2. $LastLogonTimeMark= (get-date) - $InactiveDays
  3. #
  4. Get-QADComputer -IncludedProperties lastLogontimeStamp, useraccountcontrol|
  5. ?{$_.lastLogontimeStamp -lt $LastLogonTimeMark}|
  6. select name, lastLogontimeStamp, whenCreated, @{Name="Disabled"; Exp={$_.useraccountcontrol -band 2}}|
  7. ?{$_.Disabled -eq 0}|
  8. sort lastLogontimeStamp| ft Name,lastLogonTimeStamp, whenCreated, Disabled –AutoSize
  9.  

Share with your friends:

Print