---
title: "DirectoryEntry problem"
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/86673-directoryentry-problem"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "aleborg"
published: "2003-09-22T18:36:20.000Z"
updated: "2003-09-22T18:42:19.000Z"
replies: 1
views: 203
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/86673-directoryentry-problem"
---

# DirectoryEntry problem

## #1 — aleborg, 2003-09-22T18:36Z

Jag har följande kod för att uppdatera i IIS:en:

```
DirectoryEntry newRoot= new DirectoryEntry("IIS://" + server + "/W3SVC");
DirectoryEntry deNewVDir = newRoot.Children.Find(websitenumber,"IIsWebVirtualDir");
				
deNewVDir.Properties["Path"][0] = homepath;
				
deNewVDir.CommitChanges();
newRoot.CommitChanges();

deNewVDir.Close();
newRoot.Close();
```

Men får följande exception:
System.Runtime.InteropServices.COMException (0x80005008): Exception from HRESULT: 0x80005008. at System.DirectoryServices.Interop.IAdsContainer.GetObject(String className, String relativeName) at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName) at WebCreSiterWeb.IISWebsite.EditTarget() 

Hur gör man egentligen för att ändra mha DirectoryEntry?

Permalänk: https://www.webforum.nu/p/86673

## #2 — aleborg, 2003-09-22T18:42Z

löste det, var inne i fel del av sökvägen bara :r

Permalänk: https://www.webforum.nu/p/1164392

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/86673-directoryentry-problem
