Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to update active directory using asp only

Reply
Thread Tools

how to update active directory using asp only

 
 
astarter astarter is offline
Junior Member
Join Date: Jun 2007
Posts: 4
 
      06-11-2007
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,c o,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(
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
 
Reply With Quote
 
 
 
 
astarter astarter is offline
Junior Member
Join Date: Jun 2007
Posts: 4
 
      06-12-2007
hi, please reply yar, i am really needing it...
Hope you understand my condition.
desperately waiting for some good replies.......
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Possible? Authentication using Windows/Active directory, but access SQL Server using Membership class Andy ASP .Net 1 04-15-2006 08:48 PM
how can I update Active Directory? =?Utf-8?B?ZGhucml2ZXJzaWRl?= ASP .Net 2 02-04-2005 02:28 PM
Modify AD Active directory based on user name only. Shaker ASP .Net Security 1 12-28-2004 10:50 PM
Active Directory Search fails ("The directory service is unavailab ejcosta ASP .Net Security 2 10-08-2004 09:57 AM



Advertisments