Search your domain for a particular smtp email address, or 'proxyAddresses'
'********************************************
'script to search a domain for a particular SMTP address. searches
'users, groups and public folders. might not search against default
'users container, i don't use it and didn't test against it.
'Just modify the strAddress line to contain the address you're searching for
'thanks to EE's Chris-Dent for his OURecurse subroutine
'written by EE's kristinaw, 05/20/05
strAddress = lcase("SMTP:kris@norfolk.gov")
strFound = FALSE
Set objRootDSE = GetObject("LDAP://rootDSE")
Set objDomainRoot = GetObject("LDAP://"& _
objRootDSE.Get("defaultNamingContext"))
wscript.Echo "Searching for address "& strAddress
For Each objItem in objDomainRoot
If strFound = FALSE Then
'wscript.Echo objitem.Name
If objItem.Class="organizationalUnit" Then
'wscript.Echo objItem.ADSPath
OURecurse objItem.ADSPath
End If
If objItem.Class="user" Then
'wscript.Echo objItem.name
ProcessUsers objItem
End If
If objItem.Class="group" Then
ProcessUsers objItem
End If
'The below portion of code searches public folders
If objItem.cn ="Microsoft Exchange System Objects" then
'wscript.Echo objItem.Name
OURecurse objItem.ADSPath
End If
End If
Next
wscript.Echo "All Done"
Set objRootDSE = Nothing
Set objDomainRoot = Nothing
'**********************************************
Sub ProcessUsers(objUsers)
On Error Resume Next
'wscript.Echo objUsers.Name
set objProxy = GetObject("LDAP://"& objUsers.distinguishedName)
For Each proxyAddresses in objProxy.GetEx("proxyAddresses")
If lcase(proxyAddresses) = strAddress then
If objProxy.Class="publicFolder" then
wscript.Echo "Proxy address "& _
strAddress &" is assigned to a Public Folder named '"& _
objProxy.displayName &"', "&"in Public Folder Path "& _
objProxy.folderPathname
Else
wscript.Echo "Proxy address "& _
strAddress &" is assigned to the user or group "& _
"with a samAccountName of '"& objProxy.saMAccountName & _
"' and a display name of "& objProxy.displayName
End If
strFound = TRUE
End If
Next
set objProxy = Nothing
End Sub
'**********************************************
Sub OURecurse(objFirst)
' This OU is responsible for going through the AD Structure
Dim objOrgUnit, objItem
Set objOrgUnit = GetObject(objFirst)
For Each objItem in objOrgUnit
If objItem.Class="user" Then
'wscript.Echo objItem.Name
ProcessUsers objItem
End If
If objItem.Class="group" Then
ProcessUsers objItem
End If
If objItem.Class="publicFolder" Then
ProcessUsers objitem
End If
If objItem.Class="organizationalUnit" Then
'wscript.Echo objItem.Name
OURecurse objItem.ADSPath
End If
Next
Set objOrgUnit = Nothing
Set objFirst = Nothing
End Sub
'********************************************
'script to search a domain for a particular SMTP address. searches
'users, groups and public folders. might not search against default
'users container, i don't use it and didn't test against it.
'Just modify the strAddress line to contain the address you're searching for
'thanks to EE's Chris-Dent for his OURecurse subroutine
'written by EE's kristinaw, 05/20/05
strAddress = lcase("SMTP:kris@norfolk.gov")
strFound = FALSE
Set objRootDSE = GetObject("LDAP://rootDSE")
Set objDomainRoot = GetObject("LDAP://"& _
objRootDSE.Get("defaultNamingContext"))
wscript.Echo "Searching for address "& strAddress
For Each objItem in objDomainRoot
If strFound = FALSE Then
'wscript.Echo objitem.Name
If objItem.Class="organizationalUnit" Then
'wscript.Echo objItem.ADSPath
OURecurse objItem.ADSPath
End If
If objItem.Class="user" Then
'wscript.Echo objItem.name
ProcessUsers objItem
End If
If objItem.Class="group" Then
ProcessUsers objItem
End If
'The below portion of code searches public folders
If objItem.cn ="Microsoft Exchange System Objects" then
'wscript.Echo objItem.Name
OURecurse objItem.ADSPath
End If
End If
Next
wscript.Echo "All Done"
Set objRootDSE = Nothing
Set objDomainRoot = Nothing
'**********************************************
Sub ProcessUsers(objUsers)
On Error Resume Next
'wscript.Echo objUsers.Name
set objProxy = GetObject("LDAP://"& objUsers.distinguishedName)
For Each proxyAddresses in objProxy.GetEx("proxyAddresses")
If lcase(proxyAddresses) = strAddress then
If objProxy.Class="publicFolder" then
wscript.Echo "Proxy address "& _
strAddress &" is assigned to a Public Folder named '"& _
objProxy.displayName &"', "&"in Public Folder Path "& _
objProxy.folderPathname
Else
wscript.Echo "Proxy address "& _
strAddress &" is assigned to the user or group "& _
"with a samAccountName of '"& objProxy.saMAccountName & _
"' and a display name of "& objProxy.displayName
End If
strFound = TRUE
End If
Next
set objProxy = Nothing
End Sub
'**********************************************
Sub OURecurse(objFirst)
' This OU is responsible for going through the AD Structure
Dim objOrgUnit, objItem
Set objOrgUnit = GetObject(objFirst)
For Each objItem in objOrgUnit
If objItem.Class="user" Then
'wscript.Echo objItem.Name
ProcessUsers objItem
End If
If objItem.Class="group" Then
ProcessUsers objItem
End If
If objItem.Class="publicFolder" Then
ProcessUsers objitem
End If
If objItem.Class="organizationalUnit" Then
'wscript.Echo objItem.Name
OURecurse objItem.ADSPath
End If
Next
Set objOrgUnit = Nothing
Set objFirst = Nothing
End Sub
'********************************************
73 Comments:
Kris,
I have been looking for a script that would locate an email address in my Exchange Server as I wanted to add the email address to an existing user and I kept getting an error saying that it already existed, which really confused me.
Thanks to your script I have discovered a Public Folder that has the email address and was stopping me from adding it to the user.
Brilliant piece of work that saved me hours of trying to find it by more traditional methods.
Siv
(Graham Sivill)
Martley, Near Worcester, UK.
By Graham Sivill, at 7:41 PM
I know this is an old post but I have to say, YOU ROCK!! Thank you. Awesome scripts.
By Kevin Dondrea, at 8:18 PM
Laying perfectly may not be a very important thing to your rear. Slouching can seem to be instead soothing, but it is significant to avoid this since it performs your muscle mass more challenging than it can when you do not slouch. [url=http://www.ss12w12ws.info]Hou4445r[/url]
By Anonymous, at 5:33 PM
Excellent post. I certainly appreciate this website. Stick with it!
my web page: diet plan to lose weight
By Anonymous, at 4:29 AM
Hi mates, how is the whole thing, and what you wish for to say
concerning this article, in my view its genuinely remarkable in favor of me.
My weblog; Jackpot 6000 free
By Anonymous, at 9:15 PM
Undeniably believe that which you stated. Your favorite reason seemed to be on the internet the simplest thing to be aware
of. I say to you, I definitely get irked while people
think about worries that they just don't know about. You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people could take a signal. Will probably be back to get more. Thanks
My weblog: acai ultra lean diet
By Anonymous, at 3:00 AM
Do you mind if I quote a few of your posts as
long as I provide credit and sources back to your site?
My website is in the very same niche as yours and my visitors would definitely benefit from
a lot of the information you provide here. Please let me know if this alright with you.
Thanks a lot!
my web page :: power pump muscle builder
By Anonymous, at 8:22 AM
I always used to read piece of writing in news papers but now as I am a user
of net thus from now I am using net for articles, thanks to web.
My homepage: garcinia cambogia review
By Anonymous, at 2:48 PM
I think this is among the such a lot vital info for me.
And i am glad reading your article. However want to remark on few general issues, The site taste is wonderful, the articles is
in reality excellent : D. Just right activity, cheers
Here is my web-site ... 1285 muscle review
By Anonymous, at 1:46 AM
My partner and I stumbled over here by a different
website and thought I may as well check things out.
I like what I see so now i am following you.
Look forward to finding out about your web
page for a second time.
my web site :: Best Wrinkle Creams
By Anonymous, at 10:45 AM
Hi there very nice web site!! Guy .. Excellent .
. Wonderful .. I'll bookmark your web site and take the feeds additionally? I am satisfied to search out numerous useful information right here within the post, we need develop extra techniques in this regard, thank you for sharing. . . . . .
Also visit my webpage - Buy Anatomy X5
By Anonymous, at 7:33 PM
Your style is so unique in comparison to other folks I've read stuff from. I appreciate you for posting when you have the opportunity, Guess I will just bookmark this page.
my web page: Hard knight reviews
By Anonymous, at 8:02 PM
Unquestionably believe that which you said. Your
favorite reason appeared to be on the internet the easiest thing to be aware of.
I say to you, I certainly get irked while people think about worries that they
just do not know about. You managed to hit the nail upon the top as well as defined out the whole thing without having
side effect , people could take a signal. Will likely be back to get more.
Thanks
My blog ... garcinia cambogia review
By Anonymous, at 9:46 PM
Thank you a bunch for sharing this with all of us you actually know what
you're speaking about! Bookmarked. Please also consult with my website =). We could have a link trade arrangement between us
my blog post; Garcinia Cambogia Diet
By Anonymous, at 11:39 PM
What's up, yeah this article is truly nice and I have learned lot of things from it on the topic of blogging. thanks.
Also visit my web site - Buy Raspberry Ketone
By Anonymous, at 7:43 AM
Please let me know if you're looking for a author for your weblog. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I'd love to write
some articles for your blog in exchange for a link back to mine.
Please blast me an e-mail if interested. Thank you!
my web blog :: Revitalize
By Anonymous, at 9:23 PM
I don't leave a lot of remarks, but i did a few searching and wound up here "Search your domain for a particular smtp email address, or 'proxyAddresses'". And I do have a couple of questions for you if it's allright.
Is it only me or does it look like a few of these
comments appear like written by brain dead people? :-P And,
if you are posting at other sites, I'd like to keep up with anything new you have to post. Would you list of the complete urls of your social sites like your Facebook page, twitter feed, or linkedin profile?
Here is my web site: jackpot 6000 gratis slot - http://rupgermany.bplaced.net/wiki/index.php?title=Benutzer:MurielSan -
By Anonymous, at 10:02 PM
Simply want to say your article is as surprising.
The clearness in your publish is simply nice and i could think you are a professional on this subject.
Well together with your permission allow me to
clutch your feed to stay updated with approaching post.
Thanks 1,000,000 and please continue the enjoyable work.
my blog post :: Paving Contractor Minnesota
By Anonymous, at 6:33 AM
Wonderful website you have here but I was curious if
you knew of any forums that cover the same topics talked
about in this article? I'd really love to be a part of online community where I can get responses from other experienced people that share the same interest. If you have any suggestions, please let me know. Thanks!
My homepage; Green tone pro review\ Green tone pro reviews
By Anonymous, at 10:53 PM
Ӏ'm extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the excellent quality writing, it's rare tο sеe а great blog lіke this onе these days.
Ϻy homepagе: nummerupplysningen.se
By Anonymous, at 9:05 PM
Hmm it appears like yоur ѕitе ate mу first comment (іt was extremelу long) so I gueѕs
I'll just sum it up what I wrote and say, I'm thοroughly enjoying yοur blog.
I tοo am an aspiring blog writer but I'm still new to everything. Do you have any tips and hints for newbie blog writers? I'd gеnuinely appгeciate it.
Alsо ѵisit my web site :: rhinoplasty surgery
By Anonymous, at 3:26 AM
This is nice post
service
reviews
buy
free trial
Elevate GF
cost
does it work
reviews
pills
free
grow taller
get
By ahmedshah, at 6:50 AM
Its main element is the draw out of the results peel of Garcinia cambogia extract.
Try eating fewer processed fruits like potato chips,
bacon, frozen dinners, and processed fillets that are high in sodium.
By Anonymous, at 9:26 PM
What's up, after reading this remarkable post i am also happy to share my knowledge here with mates.
Here is my weblog :: motorcycle accident lawyer
By Anonymous, at 6:56 PM
electronic cigarettes, electronic cigarette brands, electronic cigarettes reviews, ecig forum, buy electronic cigarette, smokeless cigarettes
By Anonymous, at 5:55 PM
Brilliant Content I like the way you describe your point in the content.do visit our blog for more health related content.health blog
By Unknown, at 6:37 AM
I am so grateful for your article. Much thanks.
Instagram Follower Download
By Instagram Downloader, at 4:12 AM
I am so grateful for your article. Much thanks.
Instagram001
By Instagram Downloader, at 4:20 AM
I am so grateful for your article. Much thanks.
IMessag
By Wiral Eyes, at 5:04 AM
I am so grateful for your article. Much thanks.
Best Wirless Mouse
By Unknown, at 6:10 AM
I am grateful for your article
Pc SoftBox
By Rashid Awan, at 2:06 AM
I am grateful for your article. Thanks
Medium - Grow Your Instagram Followers
By Rafail, at 1:38 AM
Really helpful article. Great share
BUY INSTA FOLLOWERS
By Marcus Unger, at 1:02 AM
Really helpful article. Great share
BWM - Best Wireless Mouses
By Unknown, at 2:47 AM
Thank you for your helpful post. nice article.
packagingcompany
By Unknown, at 12:35 AM
Thank you for your helpful post. nice article. packagingcompany
By Unknown, at 5:33 AM
Thats the Good Article for Information.
Guard Rails
By Zubair Ahmad, at 2:34 AM
Really helpful article. Great share
APPLE WIRELESS MOUSE
By STARS HIDE, at 6:17 AM
I am so grateful for your article. Much thanks.
vovogifts
By kuch bhi, at 4:41 AM
Feeling happy and proud to say that this is my favorite Blog. The postings are very unique and also an outstanding performance with the new creativity and Excellency with the new different ideas and concepts. Really I am waiting for some more new posts from you. Keep up your Excellency and efficiency in these same levels. Please visit our site. Packaging Company
By Unknown, at 1:28 AM
Thanks for this list. I have check all of these websites all are in working condition. and I can get many of the backlinks for my website thanks. packagingcompany
By Unknown, at 6:11 AM
Really helpful article. Great share
iMessage Guide
By Unknown, at 1:58 AM
I am so grateful for your article. Much thanks.
how-to-download-instagram-video-on-pc
By MainMuzammil, at 12:38 AM
Awesome & informative post. Really enjoyed that post. Thanks for sharing. Read more
By Mr Punk, at 6:52 AM
Thanks for sharing awesome Information
Window 7 Ultimate
By Rashid Awan, at 2:12 AM
Great post. Articles that have meaningful and insightful comments are more enjoyable, at least to me. It’s interesting to read what other people thought and how it relates to them or their clients, as their perspective could possibly help you in the future.Please Visit our site.Packaging Company
By Unknown, at 5:18 AM
Thats the Good work for all. Thanks.
Guardrail
By Zubair Ahmad, at 1:56 AM
I am so grateful for your article. Much thanks.
Pcsoftbox
By Rashid Awan, at 2:09 AM
I am so grateful for your article. Much thanks.
Window 7 Starter
By Unknown, at 8:43 AM
Thank you for sharing the post with us. I was looking for the similar topic. It was helpful to me. Read more
By Unknown, at 1:49 AM
Really helpful article. Great share
Brokers Forex
By kuch bhi, at 2:58 AM
I am so grateful for your article. Much thanks.
Get Twitter Followers
By Anonymous, at 6:28 AM
I am so grateful for your article. Much thanks.
work platform
By Latest News, at 7:26 AM
I am so grateful for your article. Much thanks.
stair platform
By Latest News, at 8:17 AM
I am so grateful for your article. Much thanks.
windows 7 professional 32 bit iso
By STARS HIDE, at 5:27 AM
Really helpful article. Great share
Wanelo
4shared
500Px
Public Lab
Kgbgaming
Promo DJ
Torgi Gov
It's My URL's
Manozaidimai
Web SEO Tools
By STARS HIDE, at 12:30 AM
About Best Wireless Mouses Review:
Best Wireless Mouses is an incredible platform that claims to provide extensive reviews of the best wireless mouses. You can read reviews, check prices, and get to know about the solutions of your queries regarding wireless mouses.
Best wireless mouses
Wireless Mouses
Incredible Mouses
By Shaheryar, at 5:45 AM
I am so grateful for your article. Much thanks.
windows 10 lite
By Latest News, at 8:09 AM
I am so grateful for your article. Much thanks.
windows vista home premium 64 bit iso download
By Latest News, at 9:35 AM
"Thanks for this complete list. I have check all of these websites, all are in working
and I get many of the backlinks for my website. Thanks...
SocialSteeze Reviews liveleak
SocialSteeze Review magcloud
SocialSteeze Reviews schoolofeverything
SocialSteeze Reviews ranker
SocialSteeze Reviews hackerearth
SocialSteeze Review 1888bets
By Zubair Ahmad, at 10:03 AM
Really helpful article. Great share
Get Satisfication
Visual Ly
Open Ideo
Grasz Online
Font Library
Vimeo
8Tracks
Feedbooks
Steepster
3D Artist Online
By Unknown, at 1:57 AM
Really helpful article. Great share
Sysnative
Zenstudios
Insubuy
Velo Ster
CrowdFunding
By Omega Indl, at 2:16 AM
digbox
By Anonymous, at 2:26 PM
Thanks for shareing this greate information
huntproduct
sandwise
storeboard
ideafit
adobe
udemy
soundcloud
By Mohit, at 2:11 PM
This comment has been removed by the author.
By Valencia home theater seating, at 5:25 AM
very helpful.
how to find help with movers
how to move heavy furniture
mistakes to avoid during relocation
benefits of using movers
solutions for moving easily at a low cost
Hidden Prices to move
By House RemovalsTwickenham, at 3:10 AM
https://www.indiegogo.com/individuals/22259709
https://hubpages.com/@creativeharmony
https://speakerdeck.com/creativeharmony
https://www.codecademy.com/profiles/rajaPoddar6159479792
https://pantone.ccnsite.com/rohitpaul1
By Mohit, at 9:49 AM
http://www.authorstream.com/creativeharmonyy/
https://www.mindmeister.com/users/channel/39329149
https://devpost.com/rajapoddar956
https://www.adsoftheworld.com/user/creativeharmony
https://www.intensedebate.com/people/creativeharmony
https://rhizome.org/profile/creative-harmony/
https://slides.com/creativeharmony
https://onmogul.com/creativeharmony
By Mohit, at 9:50 AM
https://www.behance.net/rohitpaul1
https://issuu.com/creativeharmony
https://www.wattpad.com/user/creativeharmony
https://seekingalpha.com/user/50564385/comments
https://www.smashwords.com/profile/view/creativeharmonyy
https://500px.com/creativeharmony
https://www.udemy.com/user/creativeharmony2/
http://www.magcloud.com/user/creativeharmonyy
https://creativeharmony.contently.com/
https://list.ly/rajapoddar956/lists
By Mohit, at 9:51 AM
https://www.reddit.com/user/Sherry312/comments/cph7nf/eggs_more_beneficial_for_health/
https://moneyking.doodlekit.com/
http://itsourme.simplesite.com/
https://hridaysarkar741.wixsite.com/megear
By Mohit, at 9:52 AM
This comment has been removed by the author.
By facts of the day, at 5:47 AM
Step Your Cooking Up A Notch Today!
Flavoring Up Your Meals With These Simple Cooking Tips
By Restaurant Lines, at 4:23 AM
The topic is very appealing. I am pleased to read this. Thank you so much for this post.
Anyways, if you wanted to sell your wrecked or damaged car but not know how then stop worrying about it and just give a call to Baba wreckers Melbourne. The best car wreckers service in the whole Melbourne region. Provides the best service with instant cash for your vehicle.
By Katniss Cruz, at 6:44 AM
Post a Comment
<< Home