deleting old Computer accounts 2000/2003 domain

Does anyone have the following code in VB6?

1.  Code that will delete a computer account

2. Code to list computer account updated dates to find old accounts


LVL 1
bluedragon99Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
cookreConnect With a Mentor Commented:
Well, it's VBScript, not VB6, but it translates easily:

Delete account:
http://www.microsoft.com/technet/community/scriptcenter/user/scrug13.mspx

Alas, I can't find a most recent update date for user accounts.
0
 
waitandsee123Connect With a Mentor Commented:
In question 2. Code to list computer account updated dates to find old accounts

Would the last logon date and time be an acceptable substitute for account update dates?

If so, and if you can get the value from a command shell command, you can call out the net user command for local accounts.

net user "whateverusername" | find /i "Last Logon"

OR for domain user accounts

net user "whateverusername" /domain | find /i "Last Logon"

Then just parse the strings into the data you want to retrieve.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.