how to update active directory using asp only

Joined
Jun 11, 2007
Messages
4
Reaction score
0
Hi, i am a starter in this asp thing and currently working on a project to update user's property of MS outlook. I have written down this code to fetch user's property to show him in a user interface screen which i have made also.

option explicit
DIM FLAG
FLAG="false"
DIM displayname,department,alias,company,email, address,title,city,state, zipcode, country,tel_ext, tel_off, tel_hom, tel_mob
DIM rsTemp, adscon, com, strsql
Set rsTemp = server.CreateObject("ADODB.Recordset")
Set adscon = server.CreateObject("ADODB.connection")
adscon.Provider = "ADsDSOObject"
adscon.Properties("User ID") = Request.ServerVariables("Auth_User")
adscon.Properties("Password") = Request.ServerVariables("Auth_Password")
adscon.Properties("Encrypt Password") = true
adscon.Open
set com = server.CreateObject("ADODB.command")
set com.ActiveConnection = adscon
strsql = "SELECT Streetaddress,Postalcode,telephonenumber,company,co,cn, title, department, mail, samAccountName, l, st FROM 'GC://ncorp-dc-01' where objectClass='User' and samAccountName = '" & Request.ServerVariables("Auth_User") &"'"
com.CommandText = strsql
Set rsTemp = com.execute(strsql)
if rsTemp.RecordCount = 1 then
displayname=rsTemp(6)
alias=rsTemp(2)
title=rsTemp(5)
department=rsTemp(4)
city=rsTemp(1)
state=rsTemp(0)
email=rsTemp(3)
country=rsTemp(7)
company=rsTemp(8)
tel_off=rsTemp(9)
zipcode=rsTemp(10)
address=rsTemp(11)
end if
FLAG=TRIM(Request.Form("flag"))
if FLAG="true" then
Response.Write(tel_off & "<br>")
tel_mob=TRIM(Request.form("tel_mob"))
tel_ext=TRIM(Request.form("tel_ext"))
tel_hom=TRIM(Request.form("tel_hom"))
tel_off=TRIM(Request.form("tel_off"))
end if

Now Please tell, if I want to update user's phone no. only, then how to do so. Normal "Update set " command of sql is not working here. Please provide coding in asp only as I dont know the asp.Net thing.
Hoping for some suggestions.
thanking you
 
Joined
Jun 11, 2007
Messages
4
Reaction score
0
please reply friends

hi, please reply yar, i am really needing it...
Hope you understand my condition.
desperately waiting for some good replies.......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top