Re: Removing local users
- From: "Pegasus \(MVP\)" <I.can@xxxxxxx>
- Date: Sat, 22 Oct 2005 10:45:24 +1000
"Chris Hall" <someone@xxxxxxxxxxxxx> wrote in message
news:edroswn1FHA.3000@xxxxxxxxxxxxxxxxxxxxxxx
> Greetings,
>
> We've been using local users on about 100 PCs and are in the process on
> moving to a Windows A.D. environment. Is there an easy way to delete users
> from these workstations? Scripting, GPOs, etc? We're currently looking at
a
> piece of software--User Manager Pro--for this purpose, but would rather
save
> the dollars if possible. BTW, the PCs are w2k and xp.
>
> Thanks,
> Chris
You could run this batch file on each workstation:
@echo off
goto Start
--------------------------------------------------------------
Create a list of all users defined on this machine. Note that
the process will fail if there are user names with embedded
spaces.
17.6.2003 Fritz Lang
--------------------------------------------------------------
:Start
cd /d "%temp%"
net user | more +4 | find /i /v "successfully" >users.1
if exist users.2 del users.2
for /F "tokens=1" %%n in (users.1) do echo %%n>>users.2
for /F "tokens=2" %%n in (users.1) do echo %%n>>users.2
for /F "tokens=3" %%n in (users.1) do echo %%n>>users.2
type users.2 | sort > users.txt
for /F %%a in (users.txt) do if /i not %%a==Administrator (
echo net user %%a /del
echo rd /s /q "%allUsersProfile%\..\%%a"
)
Remove the words "echo" in the two lines towards the end
to activate the batch file.
You can use psexec.exe (www.sysinternals.com) if you wish
to run this script from a central location.
batc
.
- Follow-Ups:
- Re: Removing local users
- From: Chris Hall
- Re: Removing local users
- References:
- Removing local users
- From: Chris Hall
- Removing local users
- Prev by Date: Re: Windows 2000 server seeing more than 4 gigs of memory
- Next by Date: Re: Disk defrag for 2000
- Previous by thread: Removing local users
- Next by thread: Re: Removing local users
- Index(es):
Relevant Pages
|