Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Disabling Accounts via Command Line

Posted on 2004-09-28
5
Medium Priority
?
292 Views
Last Modified: 2010-08-05
Hi

Does anyone know of a tool and the syntax to disable a user account in Active Directory form the command line?

Thanks

Ste
0
Comment
Question by:stewatts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 57

Accepted Solution

by:
Pete Long earned 200 total points
ID: 12168333
0
 
LVL 57

Assisted Solution

by:Pete Long
Pete Long earned 200 total points
ID: 12168380
example

dsmod CN=username,DC=domainname,DC=com -disabled yes
0
 

Author Comment

by:stewatts
ID: 12168398
How would I do this with the following user:

username testuser
domain itdom-tr

Many thanks
0
 
LVL 10

Expert Comment

by:Longbow
ID: 12168676
You van use notepad and put the next script in then save it as .vbs.
Change "computername" with the computername of your server.
I don't have tried. No server 2000 here now :

'--- Disable account ADSI script ---
Set WSHShell = WScript.CreateObject("WScript.Shell")
UName = InputBox("Disable account","Username to disable : ")

Set UserObj = GetObject("WinNT://ComputerName/" & UName)
UserObj.AccountDisabled = True
UserObj.SetInfo
Set UserObj = Nothing
'--- End Disable account ---
0
 
LVL 10

Expert Comment

by:Longbow
ID: 12168682
The script will open an inputbox to allow you to enter a username
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question