Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using VBS To Find All Objects Which Match an LDAP Filter

Posted on 2004-09-15
4
Medium Priority
?
555 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
3 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

876 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