Query all Alternative UPN Suffix

S

Stew

Can someone provide a query that will list all of the
Alternative UPN Suffix's as seen in "AD Domains and
Trusts".

Thanks
 
J

Joe Richards [MVP]

You need to look at the object

cn=partitions,<config>

specifcally at the attribute upnsuffixes

If using adfind, you can see them with the following (watch for wrap)

adfind -b cn=partitions,cn=configuration,dc=domain,dc=com -f * -s base upnsuffixes


joe
 
S

Stew

Thanks Joe, is there a way to do this with ASP or vbscript
so I can use the findings in a web page?
 
J

Joe Richards [MVP]

Sure, just do a standard bind with vbscript LDAP provider and ask for the
attribute...

partpath="cn=partitions,cn=configuration,dc=domain,dc=com"
set o=getobject("LDAP://"&partpath)
upns=o.getex("upnsuffixes")
foreach suffix in upns
wscript.echo suffix
next


In production I would add error checking in case there are no alternative upn
suffixes and I would dynamically look up the configuration partition. This is
all things that you can see how to do from the TechNet scriptcenter. If you
intend to do much ad scripting I recommend you pick up the Activw Directory
Cookbook.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top