![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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 | Query LDAP to get user Telephone Hello, Could you please send me a sample script, about how get the user telephone field from active directory? We have Windows 2003 and the users are using XP. We need the user telefhone number from active directory in order to configure the softphone at user logon. Thank you in advance. -- Greetings, Omar Rodríguez Telecomunications Analyst & Programmer VoiceTeam |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Query LDAP to get user Telephone Omar Rodríguez wrote: Quote: > Could you please send me a sample script, about how get the user telephone > field from active directory? > > We have Windows 2003 and the users are using XP. > > We need the user telefhone number from active directory in order to > configure the softphone at user logon. > Thank you in advance. > ========= Set objSysInfo = CreateObject("ADSystemInfo") Set objUser = GetObject("LDAP://" & objSysInfo.UserName) strPhone = objUser.telephoneNumber Call MsgBox("Your telephone number in Active Directory is " & strPhone) ====== To retrieve for another specified user, then change the number and save, the code could be similar to: ====== ' Bind to user using Distinguished Name. Set objUser = GetObject("LDAP://cn=Jim Smith,ou=West,dc=MyDomain,dc=com") ' Retrieve telephone Number. strPhone = objUser.telephoneNumber ' Display. Call MsgBox("Old telephone number is " & strPhone) ' Assign a new number. objUser.telephoneNumber = "123-456-3451" ' Save changes. objUser.SetInfo ==== Does this help? -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Query LDAP to get user Telephone Thank you a lot Richard. It works. This news group really works! -- Greetings, Omar Rodríguez Telecomunications Analyst & Programmer VoiceTeam "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in message news:Oo2pv5c6JHA.1416@xxxxxx Quote: > Omar Rodríguez wrote: > Quote: >> Could you please send me a sample script, about how get the user >> telephone field from active directory? >> >> We have Windows 2003 and the users are using XP. >> >> We need the user telefhone number from active directory in order to >> configure the softphone at user logon. >> Thank you in advance. >> > An example to retrieve the telephone number of the current user: > ========= > Set objSysInfo = CreateObject("ADSystemInfo") > Set objUser = GetObject("LDAP://" & objSysInfo.UserName) > strPhone = objUser.telephoneNumber > Call MsgBox("Your telephone number in Active Directory is " & strPhone) > ====== > To retrieve for another specified user, then change the number and save, > the code could be similar to: > ====== > ' Bind to user using Distinguished Name. > Set objUser = GetObject("LDAP://cn=Jim Smith,ou=West,dc=MyDomain,dc=com") > ' Retrieve telephone Number. > strPhone = objUser.telephoneNumber > ' Display. > Call MsgBox("Old telephone number is " & strPhone) > ' Assign a new number. > objUser.telephoneNumber = "123-456-3451" > ' Save changes. > objUser.SetInfo > ==== > Does this help? > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| working LDAP query, well almost.. 800A000D | VB Script | |||
| How can I query LDAP in WLM? | Live Mail | |||
| Why isn't this LDAP query working on the other domain in the fores | VB Script | |||
| Not all users are retrieved in an LDAP query via ASP | VB Script | |||
| help with LDAP query | PowerShell | |||