![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Guest | find email address I have a sql table that has employee names but has there full name like Rice, Jim A. Is there a way to read AD to get there Smtp email address and update that Sql table? |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: find email address I get the email address from AD for an email lookup script I use like this: function send-htmlemail ([string]$GLOBAL:user) { $user = get-qaduser $user $usermail = $user.email .... ... .. } This way, I can type in the User name or ID and get the email address. -Jason "Jacob Saaby Nielsen" wrote: Quote: > Hey, > > sure you can. > > You can choose one of two ways, at least with Quest's AD commandlets. > > This is one way of getting the primary e-mail address: > > Get-QADObject -SizeLimit 0 | where {$_.Email -ne $null} | select name, email > > If you're looking for all the users e-mail addresses (users may have more > than one registered to them), > then you can use this: > > Get-QADObject -SizeLimit 0 -IncludedProperties ProxyAddresses | where > {$_.proxyaddresses -ne $null} | select name, proxyaddresses > > That, however, returns a whole collection of e-mail addresses per object, > where SMTP is the primary e-mail > address, and the smtp ones are the secondary ones. > > There's an even faster way of doing it though. But it's a bit quirky > (haven't had time to find out why, but my > experience is that it is...) > > This is how you get all of the users email addresses via the same cmdlet, > but using an LDAP query instead: > > Get-QADObject -SizeLimit 0 -ldapfilter '(ProxyAddresses=*)' | where > {$_.EmailAddresses -ne $null} | select name, EmailAddresses > > And, if you just need the primary email address: > > Get-QADObject -SizeLimit 0 -ldapfilter '(mail=*)' | where {$_.Email -ne > $null} | Select Name, Email > > Whichever you decide to use is fine. They provide the same output (afaik). > But the LDAP query is faster. > > Remember that the Get-QADobject returns ALL types of objects. If you're just > looking for users, either use > the -Type parameter (-Type user/group/publicfolder), or use the Get-QADuser > cmdlet instead ![]() > > Hope that helped ! ![]() > > Best regards, > Jacob > http://www.ijacob.info > > Got a PowerShell question ? Go to http://www.powershellcommunity.org ! > > "AHartman" <Hoosbruin@xxxxxx> wrote in message > news:qNednWinksl6WX_VnZ2dnUVZ_sednZ2d@xxxxxx Quote: > > I have a sql table that has employee names but has there full name like > > > > Rice, Jim A. > > > > > > Is there a way to read AD to get there Smtp email address and update that > > Sql table? > > > > > > > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: find email address Hello AHartman, sure you can. You can choose one of two ways, at least with Quest's AD commandlets. This is one way of getting the primary e-mail address: Get-QADObject -SizeLimit 0 | where {$_.Email -ne $null} | select name, email If you're looking for all the users e-mail addresses (users may have more than one registered to them), then you can use this: Get-QADObject -SizeLimit 0 -IncludedProperties ProxyAddresses | where {$_.proxyaddresses -ne $null} | select name, proxyaddresses That, however, returns a whole collection of e-mail addresses per object, where SMTP is the primary e-mail address, and the smtp ones are the secondary ones. There's an even faster way of doing it though. But it's a bit quirky (haven't had time to find out why, but my experience is that it is...) This is how you get all of the users email addresses via the same cmdlet, but using an LDAP query instead: Get-QADObject -SizeLimit 0 -ldapfilter '(ProxyAddresses=*)' | where {$_.EmailAddresses -ne $null} | select name, EmailAddresses And, if you just need the primary email address: Get-QADObject -SizeLimit 0 -ldapfilter '(mail=*)' | where {$_.Email -ne $null} | Select Name, Email Whichever you decide to use is fine. They provide the same output (afaik). But the LDAP query is faster. Remember that the Get-QADobject returns ALL types of objects. If you're just looking for users, either use the -Type parameter (-Type user/group/publicfolder), or use the Get-QADuser cmdlet instead ![]() As for the SQL, I don't do that myself. But there is this: http://www.sqljunkies.com/WebLog/mar.../28/27237.aspx Hope that helped ! ![]() -- Kind Regards, Jacob Saaby Nielsen http://www.ijacob.info PowerShell trouble ? http://www.powershellcommunity.org Quote: > I have a sql table that has employee names but has there full name > like > > Rice, Jim A. > > Is there a way to read AD to get there Smtp email address and update > that Sql table? > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can i migrate/associate http://mynick.spaces.live.com/ web address with my new email address??? | Live Messenger | |||
| how do i find ip address on email | Live Mail | |||
| find out an email address for someone | Vista mail | |||
| Changing old email address to new email address for sending pictur | Vista music pictures video | |||