.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

directory services and iis

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net
StringCollection groups = new StringCollection();
                DirectoryEntry obEntry = new DirectoryEntry(ldap);
                DirectorySearcher srch = new DirectorySearcher(obEntry, "(sAMAccountName=" + Login_Xconnect.UserName + ")");
                // DirectorySearcher srch1= new DirectorySearcher(obEntry,
                SearchResult res = srch.FindOne();
                if (null != res)
                    DirectoryEntry obUser = new DirectoryEntry(res.Path);
                    // Invoke Groups method.
                    object obGroups = obUser.Invoke("Groups");
                    foreach (object ob in (IEnumerable)obGroups)
                        // Create object for each group.
                        DirectoryEntry obGpEntry = new DirectoryEntry(ob);

            catch (Exception ex)
            int flag = 0;
            foreach (string gp in groups)
                if (gp == "CN=testgroup1")
                    flag = 1;

i use this to r

View Complete Post

More Related Resource Links

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

AD FS 2.0 in Identity Solutions: Using Active Directory Federation Services 2.0 in Identity Solution


This article explains how you can use Active Directory Federation Services (AD FS) 2.0 to claims-enable Windows Communication Foundation (WCF) services and browser-based applications. The focus is on the token issuance functionality in AD FS 2.0. You'll find out how to use AD FS 2.0 as an identity provider; set up an AD FS 2.0 security token service (STS) to interact with WCF; federate AD FS 2.0 with your custom STS or another AD FS 2.0; enable Web single sign-on and federation with WS-Federation and SAML 2.0 protocols; and externalize authentication logic through Visual Studio. You'll come away appreciating how AD FS 2.0 and Windows Identity Foundation make programming identity solutions in Windows less of a chore.

Zulfiqar Ahmed

MSDN Magazine November 2009

Single Sign-On: A Developer's Introduction To Active Directory Federation Services


Use Active Directory Federation Services to allow other organizations to use your Web applications without the need for you to grant access explicitly.

Keith Brown

MSDN Magazine November 2006

Got Directory Services?: New Ways to Manage Active Directory using the .NET Framework 2.0


System.DirectoryServices is a managed code layer on top of Active Directory Service Interfaces, and you can employ it to better manage Active Directory from your code. Here Ethan Wilansky helps you get started.

Ethan Wilansky

MSDN Magazine December 2005

Using custom code on report services to check if directory does exist or not (need help)


I am trying to check if a directory does exist.  I have used the vb.net to create a very small function and embedded into the "Custom code:" section of Report Properties.  It’s output is a return of Y or N (string) or 1 or 0 (Integer) if directory exist or not. 

Here is the code which returns a String

    Function ifDirExist(ByVal mypath As String) As String

        Dim flag As String

        If Not System.IO.Directory.Exists(mypath) Then

            flag = "N"

Can I pass a user's active directory group as a parameter to reporting services?


Hi there,

I am wondering if I can pass a user's active directory group as a parameter to reporting services? If so, how can I do that (e.g. where can I get that group from?)?

Is there something as User.UserID for active directory groups?

Many Thanks and best wishes



WebApplication can't find Directory.Services



I'm develloping and web app that needs access to Active Directoy. I'm doing this trough LDAP.

It's was working fine until I changed the type of project in my Visual Studio 2008 from web site to web application. Now it gives me some errors:

"The type or namespace name 'DirectoryEntry' could not be found (are you missing a using directive or an assembly reference?)"

"The type or namespace name 'DirectorySearcher' could not be found (are you missing a using directive or an assembly reference?)"

"The type or namespace name 'SearchResult' could not be found (are you missing a using directive or an assembly reference?)"



I've been reading some webarticles about web site vs web application, but I'm still not convenced why web app's are better than a website. In my particular case I'm develloping an intranet project, and everything was working fine. If someon could also help me choose what's best I would be very thankfull.


Anyway, Can someone help me?




All that as to do with that

Active Directory Certificate Services + ASP.NET



We have a requirement to issue certificates from our organization for the purpose of authentication to our ASP.NET application. The client certificates are installed on client machines and submited to ASP.NET application. The ASP.NET application checks a field from certificate (Eg: Subject O) and authenticate the user.


Deployment is done on Windows Server 2008. Use Active Directory Certificate Services to issue client certificates for users. AD CA is installed as Stand Alone (no AD integration) with certsrv Web App enabled. This allow users to connect to a web site (certsrv) and to make certificate requests using the Web Browser Certificate request option.


1) When the user press Web Browser Certificate he is presented with a couple of fields to complete. We need one additional field (Eg: ID) so that we can identify the user in our database (after this certificate is submited to our web application). So the problem is how can we add or remove fields at Identifying Information step?

2) After the user submits the request (complete all the requested fields) we need to automatically allow user to download the certificate if the ID is correct without having an administrator to verify the request certificate queue. So the problem is how can we automatically approve the certificate request?

SQL Server and Alternative Directory Services

We have a customer who are looking to use OpenLDAP instead of Active Directory for authentication. We have had little/no exposure to open source alternatives to AD.

Ideally it will be something to prove it is a bad idea, as despite the upfront cost savings, no use of Windows authentication, etc. we feel the ongoing support and maintenance will be much more difficult and hence expensive.

Does SQL Server support any alternative directory services? If that is the case, is there an official statement which proves it is bad practice?

Many Thanks.

Installing and Uninstalling Services

Installing and Uninstalling Services.Unlike most projects you create in Visual Studio .NET, Windows Service projects cannot be run directly from the development environment by pressing F5. This is because the service in the project must be installed before the project can run.

You can quickly install your service application by using a command line utility called InstallUtil.exe.

Getting Started with Windows SharePoint Services

Of all of the capabilities of SharePoint, I thought I would start with the most basic installation - as a corporate intranet. It is likely that we will need to discuss some of the elements of SharePoint as we go along, so this also gives us the opportunity to review these elements for future reference.

Before going into too much detail, I would like to point out that you can try the core SharePoint framework (known as Windows SharePoint Services or WSS) for free. On Microsoft's Web site you can download a trial version of Virtual PC 2004 (VPC). Using VPC, you can install the Windows 2003 Evaluation Kit and the WSS add-on. This combination will give you 45 days to evaluate the setup.

Building a 3-Tier App with Silverlight 3, .NET RIA Services, and Azure Table Storage

Silverlight 3, .NET RIA Services, and Windows Azure Services Platform makes a 3-tier Cloud application easier to build: Silverlight 3 as presentation tier, .NET RIA services as the business logic and data access tier, and Windows Azure Table as the data storage tier. The sample application in this article demonstrates the architecture with a simple Survey application with all these technologies working together from Windows Azure.

New Features in Windows SharePoint Services 3.0

Windows SharePoint Services 3.0 (WSS 3.0) is the next version of WSS 2.0, released on 2007, and Microsoft Office SharePoint Server 2007 (MOSS 2007) is built on top of this. Windows SharePoint Services 3.0 takes full advantage of Microsoft ASP.NET 2.0 and the core Microsoft .NET 2.0 runtime. WSS 3.0 offers a lot of new features and programmability support. I have consolidated a list of new features and enhancements in the below section:

Returning a DataSet From a Web Services: Step-by-Step

This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.


This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.

.NET Web Services Tutorial

Visual Studio .NET makes .NET programming simple and accelerates the development process. It hides a lot of repetitive and configuration details from the user and improves productivity. However, sometimes you would like to program for .NET without using VS .NET; for example, you want to learn .NET framework programming and do not have access to VS .NET or you want to know what is actually going on under the hood.

Writing a Web Service in .NET using VS .NET very is easy. However, it is possible to write Web Services using the plain .NET SDK. I struggled a lot to write Web Services without VS .NET and tried to find help on the Net. There are a lot of examples available for writing Web Services using VS.NET, but you will rarely find any examples of writing Web Services using only the .NET SDK. This article is exactly for this purpose. It looks at Web Services development using the .NET SDK alone.

Why use Web services ?

Before the arrival of Web services, other technologies and architectures existed that met the functionality of today´s web service. Microsoft's version of these technologies, are called Component Object Model (COM), and subsequently Distributed COM (DCOM). WinDNA is a comprehensive term for implementing the above two distributed software development technologies. These technologies typically use the TCP/IP protocol.

CORBA - Common Object Request Broker is a competitor of COM, developed by a consortium of vendors called the Object Management Group. Although these technologies were a breakthrough in distributed computing and served such ends well for at least five years, there were many limitations. Concerning

Integrate Reporting Services with Silverlight and RIA Services

One of the most wanted future features in Silverlight is the possibility to create business reports using Reporting Services. In this article, I will show how to use the existing Reporting Services technology with Silverlight and RIA Services combination.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend