Solved

Script to show user primary email address at login?

Posted on 2006-06-11
2
302 Views
Last Modified: 2011-10-03
Is there are VB or  any other script that shows user primary email address at login.

We have 1500 users with Windows 2003 and exchange 2003 AD environmnent.

Exchage is hosting 2 domains. So half of the users have 1 account and rest has other domain primary email account. I want to show users their primary email address at login.
Is there a way to display this information.

Thanks
IZAq
0
Comment
Question by:sqazi786
[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
2 Comments
 
LVL 71

Accepted Solution

by:
Chris Dent earned 125 total points
ID: 16883827

Yep, it would have to be a message box; VbScript doesn't have much in the way of visual components.

You might also want to add error control so it can deal with users that don't have any e-mail addresses. Otherwise this is a very quick bit that'll return the primary:


Set objADSystemInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)

arrAddresses = objUser.GetEx("proxyAddresses")
For Each strAddress in arrAddresses
      If InStr(strAddress, "SMTP:") Then
            strAddress = Replace(strAddress, "SMTP:", "")
            Exit For
      End If
Next

MsgBox strAddress
0
 

Author Comment

by:sqazi786
ID: 16887134
Thanks chris, Exactly what i was looking for
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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