Remove and delete certain local accounts

0

How can I delete a user from the command line?


I am just starting working at a college and I'm inheriting a unintelligible mismash of local and domain accounts across a span of computers ranging from XP to Windows 8.

with upwards of two thousand computers that need to be gone through and remove anywhere between no and 5 local users accounts (so that people will start actually using their domain counterparts)

I've seen people saying net user username /del which apparently misses possibly some stuff in the registry and doesn't remove the folder for C:\users\username either

I've seen people recommending DelProf2 which seems like it would get the job done, and has some filters, but has no way for me to specify which accounts to leave or delete other than direct interaction or filtering based on time (which won't work because I am changing the account they should be using) Also, I would prefer to stay away from downloading and running a file on all of the computers and stick to regular commnands/vbscript/powershell/stuff

Most of the computers have either one or two local accounts that I would want to remove. The rest I would want to spit out to a file for my manual review (some of them have been embedded in systems and would need undoing by hand) but I can worry about that part in the script I'll be writing.

I am looking for a command line way or a set of steps to delete a given user. If doing net user username /del and then deleting the relevant registry keys is that, then please give some sources.

PsychoData

Posted 2014-10-06T19:23:28.140

Reputation: 1 331

Question was closed 2014-10-06T19:25:42.457

IF you would like newer/different answers to the existing version of this question, please place a bounty on the original instead of asking the same question again. – Ƭᴇcʜιᴇ007 – 2014-10-06T19:26:35.933

How about asking for a complete answer? I couldn't find one – PsychoData – 2014-10-06T19:28:56.047

It will give you a chance to comment on why you're placing the bounty. – Ƭᴇcʜιᴇ007 – 2014-10-06T19:31:06.827

I've seen the one you marked as duplicate and it was not completely removed. net user username del removed the user from being able to log in but did not remove the user folder – PsychoData – 2014-10-06T19:33:16.517

No answers