Solved

Using VBS To Find All Objects Which Match an LDAP Filter

Posted on 2004-09-15
4
545 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
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed, with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How does a lexer and parser works 2 77
countX 22 68
SQL400 max size 5 52
Problem to event 3 48
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now