OWA ASP coding for the post to achg.asp
From: Sean M. Loftus (me)_at_loftus.org)
Date: 02/02/05
- Next message: Javier J: "Windows Update Agent not installed on Windows 2003 [Error on CreateObject("Microsoft.Update.Session")]"
- Previous message: Sean M. Loftus: "Need to query domain and collect certain attributes for each user."
- Next in thread: Sean M. Loftus: "Re: OWA ASP coding for the post to achg.asp"
- Reply: Sean M. Loftus: "Re: OWA ASP coding for the post to achg.asp"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 2 Feb 2005 14:55:11 -0500
I have an issue with the way the code is manipulating the account after
posting to the "achg.asp" password change page, which is part of the
IISADMPWD package for OWA password changes. It appears to be using the WINNT
provider, which only looks at the netbios name if I'm correct and I need it
to do LDAP provider. We have a large number of users who's accounts are over
20 characters and this presents a problem when we have to have users with
longer names use domain\account instead of the account@domain UPN like we
are told them to use. if the name is shorter, no problem and if its
domain\account no problem, its just longer names in the upn format.
The relevant section of code is below and as you can see it does the WINNT
lookup. I know certain attributes are unavailable with WINNT (givenname, sn
etc.) as they don't exist with this provider.
can anyone help with the conversion of the WINNT section of code to LDAP so
I can work around this limitation? If it helps, my users will never do a
domain\account style logon so it doesn't have to do the check for these two
in the code below and would be simpler...
Thanks,
On Error resume next
dim domain,posbs, posat, username, pUser, root
domain = Trim(Request.Form("domain"))
' if no domain is present we try to get the domain from the username,
' e.g. domainusername or praesi@ultraschallpiloten.com
if domain = "" then
posbs = Instr(1,Request.Form("acct"),"\" )
posat = Instr(1,Request.Form("acct"),"@" )
if posbs > 0 then
domain = Left(Request.Form("acct"),posbs-1)
username = Right(Request.Form("acct"),len(Request.Form("acct")) - posbs)
elseif posat > 0 then
domain = Right(Request.Form("acct"),len(Request.Form("acct")) - posat)
username = Left(Request.Form("acct"),posat-1)
else
username = Request.Form("acct")
set nw = Server.CreateObject("WScript.Network")
domain = nw.Computername
end if
else
username = Trim(Request.Form("acct"))
end if
' verify that the characters in the user name are valid
if IsInvalidUsername(username) = true then
Response.Write L_InvalidUsername_Text & "."
Response.Write "<br><H3><a href=" &
Server.HTMLEncode(Request.ServerVariables("HTTP_REFERER")) & ">" &
L_Back_Text & " </a></H3>"
Response.End
end if
' verify that the characters in the domain name are valid
if IsInvalidDomainname(domain) = true then
Response.Write L_InvalidDomainname_Text & "."
Response.Write "<br><H3><a href=" &
Server.HTMLEncode(Request.ServerVariables("HTTP_REFERER")) & ">" &
L_Back_Text & " </a></H3>"
Response.End
end if
set pUser = GetObject("WinNT://" & username & "@" & domain & ",user")
' set pUser = GetObject("WinNT://" & domain & "/" & username & ",user")
if Not IsObject(pUser) then
set root = GetObject("WinNT:")
set pUser = root.OpenDSObject("WinNT://" & domain & "/" & username &
",user", username, Request.Form("old"),1)
Response.Write "<!--OpenDSObject call-->"
end if
if Not IsObject(pUser) then
set pUser = Server.CreateObject("IIS.PwdChg")
pUser.Domain = domain
pUser.User = username
end if
if Not IsObject(pUser) then
'Response.Write "domain <> null - OpenDSObject also failed"
if err.number = -2147024843 then
Response.Write L_NotExist_Text & "."
else
if err.description <> "" then
Response.Write L_Error_Text & ": " & err.description
else
Response.Write L_Errornumber_Text & ": " & err.number
end if
Response.Write "<br><H3><a href=" &
Server.HTMLEncode(Request.ServerVariables("HTTP_REFERER")) & ">" &
L_Back_Text & " </a></H3>"
end if
Response.End
end if
-- Sean M. Loftus Enterprise Architect Loftus Consulting, Inc. www.LoftusConsulting.com sean(removeme)@loftus.org
- Next message: Javier J: "Windows Update Agent not installed on Windows 2003 [Error on CreateObject("Microsoft.Update.Session")]"
- Previous message: Sean M. Loftus: "Need to query domain and collect certain attributes for each user."
- Next in thread: Sean M. Loftus: "Re: OWA ASP coding for the post to achg.asp"
- Reply: Sean M. Loftus: "Re: OWA ASP coding for the post to achg.asp"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|