Posted on 2010-09-14
I have an asp page (achg.asp) which IIS uses to call upon our domain for a users change password request. I have the domain specified (wfinet) in the asp page; however, I now have another domain in my forest and I want to specifiy that domain in the asp page too, so when the account isn’t found in the wfinet domain, it will look in the (newdomainname) for the account. I don’t know how that would be written in this asp page, as I am not an asp guru. Here is the snippet:
On Error resume next
dim domain, posbs, posat, username, pUser, root
upn_name = ""
domain = Trim(Request.Form("domain"))
' if no domain is present we try to get the domain from the username,
' e.g. domainusername or email@example.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
upn_name = Request.Form("acct")
domain = Right(upn_name, len(upn_name) - posat)
username = Left(upn_name, posat-1)
username = Request.Form("acct")
set nw = Server.CreateObject("WScript.Network")
domain = "WFINET"
' domain = nw.Computername
Note the domain WFINET, that’s the domain it works for, I need it to look at an additional domain, if the user account doesnt exist in the wfinet domain. Can you provide the asp text that would specify both domains?