Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to find an object in active directory

Status
Not open for further replies.

markdmac

MIS
Dec 20, 2003
12,340
US
Hi All,

Hope someone can help me on this. I've written a script to update an Exchange property in AD. The script works great if I hard code the path to the DistinguishedName of the object.

My problem is I need to determine the FQDN dynamically by searching for another property. Ideally I would like to be able to search starting from the DefaultNamingContext.

OK, so say I have this:

Code:
Set objDomain = getObject("LDAP://rootDse")
DomainString = objDomain.Get("DefaultNamingContext")

From here I want to search all container objects for one with an attribute:

adminDisplayName="Default SMTP Virtual Server" and return the DistinguishedName for that object.

Can anyone help me? Boss is beathing down my neck and I can't go home till I get this one done.

Thanks in advance,

Mark






[/code]
 
meant to say I need to find the DistinguishedName and not the FQDN above. Sorry.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top