Search : in
By :

Delete/remove local user from local admin gro

Last answer on Aug 25, 2009 7:32:26 am BST tony, on Nov 9, 2008 1:00:17 am GMT 
 Report this message to moderators

Hello,
we added 1000 computers to a domain/AD. Bfore deployment they imaging guy created a local user with admin rights
just for administrative purposes. After distributing the computers, we realized that we need to delete/remove the account from all the computers. we do not want to go in every computer and delete the account. All the computers have already been added to the domain in their proper OU. My question is: can someone help me with a script that can delete the user from the local admin group. I know i can disable the account but i think i would be safer to delete the account. Any help will be greatly appreciated.
thands

Configuration: Windows XP
Internet Explorer 7.0

Best answers for « delete/remove local user from local admin gro » in :
[Sed] Delete one or more lines from a file Show [Sed] Delete one or more lines from a file Removing one (or several) line (s) of a file Syntax: sed '{[/]||[/]}d' sed '{[/][,][/]d' /.../=delimiters n = line number...
Change Mac admin password without the disk ShowChange Mac admin password without the disk Issue Solution Issue I lost my MACOSX disk and forgot the admin password, is there any method to change admin password without the disk? Solution You can try this: Create a new...
Delete an Administrator account under Windows XP ShowDelete an Administrator account under Windows XP Issue Solution Issue How to delete an administrator account under Windows XP? Solution Go to Control Panel Select Administrative Tools, then Computer Management and Local Users...
Delete a file locked in the memory ShowDelete a file locked in the memory You just download an object (file, folder or program) that makes your PC crash? Moreover, no anti-malware seems to solve this problem? Finally, it is impossible to move, rename and delete this...
Download Locked Files Wizard (ex CopyLock) ShowA program, a folder or a fil used by a process can't be moved or erased. Locked Files Wizard (LFW) is a wizard allowing to move, delete or rename a file or a folder, even if it's used by a process. This program also allows to stop running process...
User management in Windows NT ShowThe notion of a user Windows NT is an operating system which manages sessions, meaning that when the system is started, it is necessary to log in with a user name and password. When Windows NT is installed, the administrator account is created by...

1

haveffun, on Nov 9, 2008 10:20:39 am GMT

Well its for windows server i guessed? and i dont think that there exist any script for what you are trying to do buddy.

instead just disable them they wont be able to log onto the account if its disabled from the domain

Reply to haveffun

2

Kendra Hall, on Jan 23, 2009 3:11:34 am GMT
  • +3

Howdo youremovethe administratorpassword for windows 2000 professional becasuse we lost the password and I can't figure out how to delete the account off of the computer can you please help me....



Thanks
Kendra Hall

Reply to Kendra Hall

8

kc, on Jun 30, 2009 1:55:59 pm BST

Hi, do u hav it in batch file? My server only accept to push in batch file or exe format.

Reply to kc

3

JW, on Feb 3, 2009 7:17:36 pm GMT
  • +2

You can write a VBscript that will remove a user from the local administrator group on all the pc in your domain. Then you set the script up to be a startup script in group policy and it will remove the user from every computers local admin group when the computer boots up. We also use this script to change the local administrator account's name and password. If the systems are Windows 2000 there are some AD dll's that have to be registered. If they are Windows XP, it will work with out any dll registration.

Sample....

Dim strLocalAdminGroup
Dim strComputer
Dim remadmins

Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
Set WshUserEnv = WshShell.Environment("User")
Set WshProEnv = WshShell.Environment("Process")

strComputer = WshProEnv("COMPUTERNAME")
remadmins = array("DomainName\UserID","Everyone")
strLocalAdminGroup = "Administrators"


For i = lbound(remAdmins) to ubound(remAdmins)
Set grp = GetObject("WinNT://" & strComputer & "/" & strLocalAdminGroup)
member = "WinNT://" & remAdmins(i)
if grp.Ismember(member) = True then
grp.Remove(member)
end if
next

Reply to JW

4

JW, on Feb 3, 2009 7:26:24 pm GMT
  • +1

That script will also remove the local "everyone" group from the local administrators group. If the account is local then leave off the domain name and slash in the array.

Reply to JW

5

Slider, on Mar 12, 2009 1:17:11 pm GMT
  • +9

Here is a one line command;
net user ACCOUNTNAME /delete

Reply to Slider

6

sujit, on Apr 7, 2009 5:36:55 am BST
  • +1

NET LOCALGROUP administrators UserName /delete

change UserName with required name & use this command in batch file.

Reply to sujit

9

 Sl, on Aug 25, 2009 7:32:26 am BST

What to do if a username or groupname are too long? For example I've got a trouble with removing a domain group from local group with in a command line? For example I'm
using next command (net localgroup "Administrator" "mydomn\uk-kre-workstation-adm" /delete) and it dosn't work, however i can to do this easely from mmc console, but question is how to run a selected task on more that 200 PC

Reply to Sl