diff --git a/Scripts/Powershell/Reporting/Inactive Users.md b/Scripts/Powershell/Reporting/Inactive Users.md new file mode 100644 index 0000000..d7f07ed --- /dev/null +++ b/Scripts/Powershell/Reporting/Inactive Users.md @@ -0,0 +1,6 @@ +``` powershell +InactiveDays = 30 +$Days = (Get-Date).Adddays(-($InactiveDays)) +Get-ADUser -Filter {LastLogonTimeStamp -lt $Days -and enabled -eq $true} -Properties LastLogonTimeStamp | +select-object Name,@{Name="Date"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('MM-dd-yyyy')}} +``` \ No newline at end of file