Webmaster Forum

Go Back   Webmaster Forum > Scripting/Programming & Debugging > ASP & VBScript Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-15-2007, 01:17 PM
bghanim bghanim is offline
Junior Member
 
Join Date: Jul 2007
Posts: 4
bghanim is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default retrieve empolyee ID from Active Directory VBS

Hello All,

I'm developing some outlook forms, and I need some VBScript to get employee ID from Active directory on my company LAN i.e. when my outlook form is accessed by any employee, his employee ID should be displayed on the form. Empolyee ID is a custom attribute that was added to each user object in AD.

Any help is greatly appreciated.

Regards,
Baha A. Ghanim
Reply With Quote

This ad is part of our Revenue Sharing program
  #2 (permalink)  
Old 07-15-2007, 05:06 PM
ALL's Avatar
ALL ALL is offline
Senior Member
 
Join Date: Oct 2006
Location: Sturgis, SD
Posts: 145
ALL is on a distinguished road
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

where or how is the id sent or located?

can you give more spacifics?
Reply With Quote
  #3 (permalink)  
Old 07-16-2007, 04:40 AM
bghanim bghanim is offline
Junior Member
 
Join Date: Jul 2007
Posts: 4
bghanim is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

Employee Id is a acustom attribute added to each user object in AD by the following script

Code:
'Get users path Set wshArgs=Wscript.Arguments Set objAD = GetObject(wshArgs(0)) z = objAD.EmployeeID a = MsgBox("User: " & objAD.cn & vbCrLf & "Employee ID: " & z & vbCrLf & vbCrLf &"Change?: ", vbYesNo + vbDefaultButton2, "Employee ID") if a = vbYes then r = InputBox("Enter New ID:", "Change EmployeeID",z) if r <> "" then objAD.EmployeeID = r objAD.setinfo end if end if


Upon clicking employee id, the following msgbox appears

Reply With Quote
  #4 (permalink)  
Old 07-16-2007, 05:03 AM
ALL's Avatar
ALL ALL is offline
Senior Member
 
Join Date: Oct 2006
Location: Sturgis, SD
Posts: 145
ALL is on a distinguished road
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

then it should be:
Code:
Set wshArgs=Wscript.Arguments Set objAD = GetObject(wshArgs(0)) z = objAD.EmployeeID
now the variable "z" now contains the employee id.
Reply With Quote
  #5 (permalink)  
Old 07-16-2007, 05:14 AM
bghanim bghanim is offline
Junior Member
 
Join Date: Jul 2007
Posts: 4
bghanim is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

Well, but how to run this code? I used cscript, but it gives error

C;\>cscript test.vbs bghanim
C:\test.vbs(3, 1) (null): Invalid syntax

BTW, is this code will run on any machine on the LAN?
Reply With Quote
  #6 (permalink)  
Old 07-16-2007, 07:53 AM
bghanim bghanim is offline
Junior Member
 
Join Date: Jul 2007
Posts: 4
bghanim is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

I've solved the problem, simply you query the LDAP database and u will get what you need :-)

Thanx for replying on my thread.

Regards,
Baha
Reply With Quote
  #7 (permalink)  
Old 08-17-2007, 07:42 PM
beamup beamup is offline
Junior Member
 
Join Date: Aug 2007
Posts: 6
beamup is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

i would appreciate if the things written are clearly written .....

I could not get it.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory domain name .com or .info Lovely General Web/Webmaster Forum 2 05-30-2007 08:56 AM


All times are GMT. The time now is 05:50 AM.


Creative Commons License
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30