Solved

Script to show user primary email address at login?

Posted on 2006-06-11
2
301 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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