[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 311
  • Last Modified:

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


0
bluedragon99
Asked:
bluedragon99
2 Solutions
 
cookreCommented:
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
 
waitandsee123Commented:
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now