how to update active directory using asp only

Discussion in '.NET' started by astarter, Jun 11, 2007.

  1. astarter

    astarter

    Joined:
    Jun 11, 2007
    Messages:
    4
    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
    astarter, Jun 11, 2007
    #1
    1. Advertising

  2. astarter

    astarter

    Joined:
    Jun 11, 2007
    Messages:
    4
    please reply friends

    hi, please reply yar, i am really needing it...
    Hope you understand my condition.
    desperately waiting for some good replies.......
    astarter, Jun 12, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    how can I update Active Directory?

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, Feb 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    12,741
    Gopal \(FMS, Inc.\)
    Feb 4, 2005
  2. Andy
    Replies:
    1
    Views:
    492
  3. ejcosta
    Replies:
    2
    Views:
    868
    Eurico Costa
    Oct 8, 2004
  4. Shaker
    Replies:
    1
    Views:
    108
    Patrick Olurotimi Ige
    Dec 28, 2004
  5. carlos seramos
    Replies:
    2
    Views:
    478
    carlos seramos
    Aug 1, 2003
Loading...

Share This Page