adsi

How to remove IIS 6 web directory property using directoryentry in C#

Hello, I want to delete particular property of IIS wen directory from Metabase. Can any one plz help me, how can we do that with DirectoryEntry class in C#? ...

Anyone know all Method Name of DirectoryEntry.Invoke

Anyone know all Method Name of DirectoryEntry.Invoke ...

querying for local groups

I'd like to retrieve all local groups on my machine (Vista in a W2k3 domain). If I run: using (DirectoryEntry de = new DirectoryEntry("WinNT://" + Environment.MachineName + ",group", null, null, AuthenticationTypes.Secure)) { } it throws an "unknown error" 0x80005000 which apparently means "invalid path" However querying for comput...

Creating local users

I am having a bad directory day. :) Could someone tell me what is wrong with this? groupName = "Monkey"; ... using (DirectoryEntry directoryEntryObject = new DirectoryEntry("WinNT://" + Environment.MachineName, "", "", AuthenticationTypes.Secure)) { using (DirectoryEntry group = directoryEntryObject.Children.Add("CN=" + groupName....

NetLocalGroupGetMembers vs AccountManagement (performance)

I find that NetLocalGroupGetMembers is many times faster than using the AccountManagement name space. How can I optimally rewrite the following code to approach the speed of accountmaangement (assume recursive = false)? Or is there a better approach? public List<Principal> GetMembersOfGroup(string groupName, bool recursive) { ...

Queries against GC, what should I watch out for?

I would like to take advantage of querying the global catalog instead of querying individual domains and following a referral chain. Is a GC always available? If not, when is it available and when is it not? (domain modes, etc) Anything else to watch out when I retarget my queries to work on the GC? I'm doing this in .NET, not sure if...

Searching global catalog

If I do a query (I plan to use SDS.P) against the global catalog, what should the starting path be so I can search the entire GC? I want to enumerate all users in GC, for example. Let's say my gc has users for 3 domains (one parent, two children): TEST.COM ONE.TEST.COM TWO.TEST.COM and i'm on a computer in ONE.TEST.COM. I do no...

LDAP vs. ADSI in manipulation of Active Directory Users

I have been requested to expose a web service for managing Active Directory Users via an intranet. I have been advised that LDAP is viewed as a security vulnerability and is not to be used. Given this constraint, I have managed to connect via ADSI with a DirectoryEntry object like this: DirectoryEntry de = new DirectoryEntry(); de.Pa...

How do I programatically add a wildcard filter for IIS?

I'm going to use System.DirectoryServices to programatically add a wildcard filter for IIS (Version 5.0 and IIS 6.0). Anyone have some food for thought? Thanks in advance! ...

ADSI Library/Control for .NET

Is there an ADSI Library out there for .NET/C#? I have been able to find bits and pieces of code to do some tasks but nothing comprehensive. I'm looking for a library that I can just drop into my code and run without having to do too much customization? I'm thinking something along the lines of MEMM for Excel Thanks. ...

Constructing Active Directory entry using PowerShell works in IIS 6 but not IIS 7

The following line of PowerShell works with IIS 6 installed: $service = New-Object System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC") However, with IIS 7 it throws the following error unless the IIS 6 Management Compatibility role service is installed: out-lineoutput : Exception retrieving member "ClassId2e4f51ef21dd47e...

Starting application pools with WMI\ADSI (C#) hangs immediately after reboot

Hi, I have encountered a strange situation where starting an application pool from a windows service (written in C#, set to "Automatic" startup) using WMI or ADSI immediately after the server reboots hangs. I'll describe the issue: We are developing a large application (Windows 2003 Server SP2, IIS 6.0) which contains the following...

ADSI Query against IIS does not agree with IIS Manager, on Vista

Using Vista... I have a script that uses ADSI to set ScriptMaps on an IIS Website. It's javascript, run within cscript.exe, and the code looks something like this: var web = GetObject("IIS://localhost/W3SVC/1"); var maps = web.ScriptMaps.toArray(); map[maps.length] = ".aaa,c:\\path\\to\\isapi\\extension.dll,1,GET,POST"; web.ScriptM...

Unable to use IIS ADSI Provider after IIS installation if ADsOpenObject was called before install

My .Net application actively uses Active Directory and installs IIS if its absent. If IIS wasn't installed on application startup and any of Active Directory-related methods were called then IIS ADSI Provider stills unavailable after IIS installation (after application restart it becomes available). Unfortunately i cannot change the oper...

Can not reference a Dll that worked earlier.

I am trying to change the Terminal Services settings programmaticly. I learned that you must use tsuserex.dll. Being c# i ran tsuserex through tlbimp and created TSUSEREXLib.dll then registered it with regasm. I got it working and wrote a framework program with it as a prof of concept. However today after I made some changes when I run m...

'working, please wait' screen with thread?

Dear Programmers, Perhaps, it is very easy for you, but I am hard working on a project (for educational purposes) that is querying adsi with TADSISearch component, for several days. I'm trying to show a 'Working, Please wait..' splash screen with a man worker animated gif on Form2 while TADSISearch is searching the Active Directory. Alt...

Updating Active Directory user properties in Active Directory using Powershell

In a Windows Server 2003 R2 environment, using Powershell v2.0, how would one duplicate the functionality of Set-QADUser to update user properties in Active Directory, like their phone number and title? The trick here being, I would like to do this without depending on Set-QADUser and I do not have the option to use the Server 2008's co...

VBScript Error when calling GetObject("WinNT://JohnDoe,User")

I have code that hasn't been touched in over a year, but the DCs were upgraded from 2008 to 2008 R2. The AD folks claim it’s not the DC upgrade but the issue started promptly after that went in. Microsoft VBScript runtime error '800a0046' Permission denied: 'GetObject' It's failing on the Set Group line. Set Group = GetObject("W...

What is the difference between Microsoft.Web.Management and System.DirectoryServices in .Net 3.5?

Hi there, I want to control, configure and manipulate IIS 6.0 and later versions via ASP.Net web application using WMI and .Net. Can i use a mix of Microsoft.Web.Management and System.DirectoryServices? Is there a difference between the two? Will System.DirectoryServices be supported for later versions of IIS. i.e IIS 7.0+ ? Where is...

Which is better for IIS administration in ASP.Net : WMI or ADSI or Managed API? and what's the difference?

Hi there, I am working on Configuring and manipulating and controlling IIS 6.0 and later versions using ASP.Net based web application. I am considering WMI, ADSI, Managed API as my options. I have a target Windows System WIN2k3 or later versions. The choice of language is C# and the application has to be built using ASP.Net. This art...