Solved

Using VBS To Find All Objects Which Match an LDAP Filter

Posted on 2004-09-15
4
551 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
[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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

632 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