Re: Problem with DirectoryServices Access
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 03/28/05
- Next message: Kevin: "Execute rights only for web app using CAS in assembly file???"
- Previous message: Brian01: "Problem with DirectoryServices Access"
- In reply to: Brian01: "Problem with DirectoryServices Access"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 28 Mar 2005 15:53:31 -0600
You also need an assembly reference to System.DirectoryServices (use the
assembly page directive or the equivalent stuff in web.config).
Joe K.
"Brian01" <Brian01@discussions.microsoft.com> wrote in message
news:518D5383-E241-4318-BA93-68873A038573@microsoft.com...
>
> I have a Win2K server in a DMZ without domain access. My C# ASP.net page
> can not see the DirectoryServices namespace. I found a KB article on the
> security issue with this, but I don't have domain accounts to use from the
> DMZ, and don't want to set the machine.config properties for all aspx
> pages.
> I just want to set the password from a simple verification application
> that
> passes the user ID and password to the below page. Can this be done
> another
> way? Thanks for any assistance.
>
> <%@ Page Language="C#" Debug="true" %>
> <%@ import Namespace="System" %>
> <%@ import Namespace="System.DirectoryServices" %>
>
> <script runat="server">
> private void Page_Load (object sender, EventArgs e){
>
> String empNum = Session["lawEmpNum"].ToString();
> String newPassword = Session["password"].ToString();
> Response.Write("Employee Number is " + empNum);
> Response.Write("Password is " + newPassword);
>
> // correct the userPath!!!
> String userPath = "WinNT://localhost/" + empNum;
> using (DirectoryEntry userEntry = new DirectoryEntry(userPath))
> {
> object[] password = new object[] {newPassword};
> object ret = userEntry.Invoke("SetPassword", password );
> userEntry.CommitChanges();
> }
>
- Next message: Kevin: "Execute rights only for web app using CAS in assembly file???"
- Previous message: Brian01: "Problem with DirectoryServices Access"
- In reply to: Brian01: "Problem with DirectoryServices Access"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]