Solved

W2k  LDAP search string All Disabled Users Windows 2000

Posted on 2004-10-01
6
158 Views
Last Modified: 2013-12-04
I want to do searches.  I have found mention of vb script (backend of ad?).

How/where could I do a query in AD to find all disabled users?

We will be upgrading to Windows 2003 in 2005 but for now, need to efficently use 2k
0
Comment
Question by:gizmoadria
[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
  • 3
  • 3
6 Comments
 
LVL 11

Accepted Solution

by:
cfairley earned 450 total points
ID: 12216654
Copy and past the script from the link into a notepad doc and name it with a .vbs extention.  

You will also need to change the strDomainDN line of the script and input your domain name. The instructions are on the same line.

http://www.rallenhome.com/books/adcookbook/src/06.13-find_disabled_users.vbs.txt
0
 

Author Comment

by:gizmoadria
ID: 12218069
mmm, interesting.

So I can then use all those vbs scripts I've bookmarked for AD?
Do they need to be run from the server?

So, for this script of finding disabled users, can you help spell it out how I would put in the config info for my domain?

**********************************************
' ------ SCRIPT CONFIGURATION ------
strDomainDN = "<DomainDN>"    ' e.g. dc=rallencorp,dc=com
' ------ END CONFIGURATION ---------

strBase   =  "<LDAP://" & strDomainDN & ">;"
**********************************************

Replace only the contents of the <>?
keep the LDAP:// ?


0
 
LVL 11

Expert Comment

by:cfairley
ID: 12218469
No, they do not have to run from the server, you can run them from the desktop.

Your config would look like the following if your domain was 123.abc.com:

**********************************************
' ------ SCRIPT CONFIGURATION ------
strDomainDN = "dc=123,dc=abc,dc=dom"    ' e.g. dc=rallencorp,dc=com
' ------ END CONFIGURATION ---------

strBase   =  "<LDAP://" & strDomainDN & ">;"
**********************************************

Replace the contents between the " ".  In this line, you are setting the variable strDomainDN to your domain name so that the script can substitute your domain name for every place it uses strDomainDN.  The variable can be named almost anything you like, it could be:

mickeymouse= "dc=123,dc=abc,dc=dom"

strBase   =  "<LDAP://" & mickeymouse & ">;"


0
When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

 

Author Comment

by:gizmoadria
ID: 12221371
Mmmm,

I still get an error in line 23, char 1 that the table does not exist
0
 
LVL 11

Expert Comment

by:cfairley
ID: 12221421
Please send me what you line 23 looks like.
0
 

Author Comment

by:gizmoadria
ID: 12647721
set objRS = objConn.Execute(strBase & strFilter & strAttrs & strScope)
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Recently, a new law in my state forced us to get a top-to-bottom analysis of all of our contract client's networks. While we have documentation, it was spotty at best for some - and in any event it needed to be checked against reality. That was m…
In today's information driven age, entrepreneurs have so many great tools and options at their disposal to help turn good ideas into a thriving business. With cloud-based online services, such as Amazon's Web Services (AWS) or Microsoft's Azure, bus…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

617 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