?
Solved

Using VBS To Find All Objects Which Match an LDAP Filter

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
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.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

718 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