Solved

Using VBS To Find All Objects Which Match an LDAP Filter

Posted on 2004-09-15
4
548 Views
Last Modified: 2011-10-03
I'm writing a script which updates all the Exchange SMTP virtual servers to point to a specific smarthost.  Basically, I need to find all objects that have attributes equal to "objectClass: top; protocolCfg; protocolCfgSMTP; protocolCfgSMTPServer;" and then set the msExchSmtpSmartHost = to something.

I realize this isn't the Exchange forum, so don't worry so much about the exchange stuff and treat it just like a VBS query for all objects that meet the query and then set the value.

I know how to set the value if I already know the DN of the object, but I would like to connect to AD without having to specify a server or possible even a domain.  Tthis has to work in multiple deployments so the domain will change, but I'll be running it on a computer in that domain so I could use an environment variable to get the current domain.

Make sense?  I'm sure there are a ton of examples and I know that search.vbs that comes with the support tools has a some code, I just don't have time to figure out the filtering stuff, etc.
0
Comment
Question by:winterminute
4 Comments
 
LVL 3

Expert Comment

by:domj
ID: 12070144
I doubt that you will be able to do it without at least specifying an LDAP server. Is this an option?

Dom
0
 
LVL 2

Author Comment

by:winterminute
ID: 12070201
Nevermind - I figured it out.  You can make an LDP serverless and domainless bind and it will go off and find your domain and a dc to talk to.
Thanks anyway --- Please refund the points.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12446951
PAQed, with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MaxSpan challenge 9 106
SQL400 max size 5 101
Problem to error 4 67
Problem to open text file 11 131
Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

830 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