Hi all, I need your help as I'm not proficient with Powershell enough to create this kind of script on my own.
I would like to disable all users of a specific OU that haven't logged in for more than X days (let's say 5 for example).
There are no service accounts in it, so only regular users.
Also, there is no need for the script to write reason for disabling in the description field as I've seen in some examples.
So only, a script that imports active directory module, target's the specified OU, checks if the logon date is above that number of days and disables them.
The setup could be like this:
Domain: random.local
Targeted OU: random/random users and groups/random users
Thanks a lot in advance for any help on this!
Regards,
Marko