SAM2009
asked on
Disable users with lastlogon and O365 lastlon over 30 days with PowerShell
Hi,
How can I code this with PowerShell?
Search all users in AD
If users lastlogon is over 30 days and his O365 lastlogon also over 30 days then
Disable users
Thanks
How can I code this with PowerShell?
Search all users in AD
If users lastlogon is over 30 days and his O365 lastlogon also over 30 days then
Disable users
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You might consider using my ADCleanup tool
https://www.experts-exchange.com/articles/30820/Active-Directory-Cleanup-Tool-ADCleanup.html
https://www.experts-exchange.com/articles/30820/Active-Directory-Cleanup-Tool-ADCleanup.html
ASKER
Many thanks!
In that case search those users in active directory for inactivity since last 30 days and disable those with onpremise
u can use dsquery or powershell for same