From e04234ef64623c056254d220d6085f7735c5d6fd Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 11 Jan 2024 20:18:47 -0700 Subject: [PATCH] Add Scripts/Powershell/Reporting/Inactive Users.md --- Scripts/Powershell/Reporting/Inactive Users.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Scripts/Powershell/Reporting/Inactive Users.md 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