On Windows, I would have to think there's something in Win32::AdminMisc that could help you.
Have fun!
In reply to Which operating system? by cebrown in thread Detecting Expired User Accounts by hux