Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Powershell Command lastlogon has "Null"

$
0
0

Hi All,

We had a requirement to find out the users, who are created but never logged on to any machines. Such users we need to disabled

I have tried the below command, but it didn't work. Also i tried to configure the below command via scheduled task, gaves an error.

Request you to please help me in correcting the commands and for configuring the scheduled task.

Search-ADAccount-AccountInactive-TimeSpan([timespan]10d)-UsersOnly|Set-ADUser-Enabled $false -WhatIf


Thanks HA


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>