CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

Windows Server 2003 Service Pack 1 SetPassword Issue

Yesterday evening, I installed SP1 for Windows Server 2003 on our Web Servers.  This morning, we got reports that new users couldn't be created on our site.  Upon investigation, it turned out that the code for creating users was failing on the following lines of code:

    /// <summary>

    /// Sets the password.

    /// </summary>

    /// <param name="userEntry">User entry.</param>

    /// <param name="password">Password.</param>

    public static void SetPassword(DirectoryEntry userEntry, string password)

    {

      object[] oPassword = new object[] {password};

      userEntry.Invoke("SetPassword", oPassword );

      userEntry.CommitChanges();

    }

The error we were getting was  'Network path was not found'.  It turns out that this service pack tightened security around invoking SetPassword on the ASDI, (which makes sense since this is usually what service packs do, tighten security).

In looking for an answer, I found the following gem on the microsoft.public.adsi.general group, specifically this post here.

 I use ADSI to manage servers in different domains,  
different networks (AD, NT DC's, standalone, servers, no
trusts, etc.) all managed from one point. I've observed
many problems where some ADSI properties/methods work and
others don't, in almost all cases it always came down to
Name Resolution
.

Since these servers are in our DMZ, it made sense that this could be true for what we were experiencing.

The Solution?

The solution for us was to make sure the IP of the LDAP server was listed in our HOSTS file.  Previously it was listed in LMHOSTS only. We have to use these files to give our inside IP addresses visibility on our DMZ (or so our network admin tells me).  Just wanted to put this out there, because this was something that worked before, pre SP1, when the IP to the LDAP server was listed in the HOSTS file only.

-Brendan





Comments

service pack 5r said:

Pingback from  service pack 5r

# May 18, 2008 2:32 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!

Our Sponsors

Proudly Partnered With


This Blog

Syndication

News

MVP
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.