(This is a question about a vague problem. I try to present all relevant data, in the hope that someone has helpful information; apologies for the long description.) Our web app We have a .NET 4 web application running in IIS 7.5 accessing Active Directory and a SQL Server database. [...] read more
I have the same web app working in three others servers. Anyone have any idea why is not working in the 4th server? See the error and stacktrace: > An operations error occurred. > > Description: An unhandled exception occurred during the execution of the > current web request. Please [...] read more
I am getting an intermittent COM Exception "An operations error occurred (0x80072020)" (shown below) when I try and query Active Directory using the method GroupPrincipal.FindByIdentity Here is my code: PrincipalContext ctx = new PrincipalContext(ContextType.Domain, Environment.UserDomainName); GroupPrincipal groupPrincipal = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, "Group to find"); I am receiving Exception: Inner Exception: System.Runtime.InteropServices.COMException [...] read more
So I have a question I'm honestly not quite sure how to ask. Essentially I have a bit of code that works fantastically on my local machine when I run it. Once I publish it to our development web server, it fails. I'm not sure if it's an IIS setup [...] read more
INTRODUCTION I'm maintaining a legacy ASP.NET 3.5 application that queries Active Directory. The application uses "Integrated Windows Authentication" and is designed to connect to Active Directory using its own security context rather than a dedicated username and password. Here is the relevant code. using (DirectoryEntry root = new DirectoryEntry()) using [...] read more
I have the following code to retrieve AD groups of a given user name in my MVC3 web application: PrincipalContext userDomain = new PrincipalContext(ContextType.Domain, username.Split('\\')[0]); UserPrincipal user = UserPrincipal.FindByIdentity(userDomain, username); PrincipalSearchResult<Principal> memberOfGroups = user.GetGroups(); IEnumerator<Principal> memberOfGroupsEnumerator = memberOfGroups.GetEnumerator(); List<string> userADGroups = new List<string>(); try { while (memberOfGroupsEnumerator.MoveNext()) { userADGroups.Add(memberOfGroupsEnumerator.Current.ToString()); } [...] read more
I'm calling LogonUser with LOGON_TYPE_NEW_CREDENTIALS and LOGON32_PROVIDER_WINNT50 to get my thread to impersonate a user in the other domain. I'm able to connect to remote file shares and everything else just fine into the untrusted domain. The problem I'm running into now is when I use GPMGMTLib to generate a [...] read more
I am using ASP.NET MVC 4 and Windows Authentication. When I am using VisualStudio everything works fine, but when I deploy my site an exception is thrown. var emailAddress = UserPrincipal.Current.EmailAddress; throws: > Unable to cast object of type > 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type > 'System.DirectoryServices.AccountManagement.UserPrincipal'. The rest works fine. Users [...] read more
I have an ASP.NET MVC application that accesses an database to retrieve some data and updates data on another database when the form is submitted. Both databases and IIS are on different servers and the users will be accessing this remotely, but everything is within out intranet. Access to the [...] read more
I'm trying to get the email address from a user that is submitting an ASP.NET form on the local intranet. When testing this on my local machine it works fine. But when I publish and begin testing it in production it doesn't like line 74. Server Error in '/' Application. [...] read more
I've been receiving a COM Exception when performing an AD Search in an ASP.NET 4.0: An operations error occurred (0x80072020) The thread Active Directory COM Exception - An operations error occurred (0x80072020) pointed me in the right direction - The issue described is permissions-related. As a workaround, I switched the [...] read more
We have a new ASP.NET web application we are deploying that uses a separate DLL which we also built which in turn interrogates the Active Directory for simple user and group membership information. The server is Windows Server 2003. The application works fine if I RDP to the server and [...] read more
I'm trying to upgrade our Exchange 2010 SP1 server to SP3 in preparation of installing a new Exchange 2013 server to take over, which requires SP3 on the 2010 machine to be able to migrate. While all prerequisite checks succeed (1 warning related to an update for failover clustering not [...] read more
I have an application that is running on an IIS 7 server, in this program I need to find all the groups that the current user is a member of. When I access the website using the browser on the server, it works perfectly, but when I try to access [...] read more
I have made a web application, which reads/writes from/to Active Directory. In my web.config file there is <identity impersonate="true"/> and <authentication mode="Windows"/> When I display System.Web.HttpContext.Current.User.Identity.Name in some label, it shows mydomain\myusername, so I think impersonation works. Now to the question. When I access the application on the server, where [...] read more
Okay so, I have been given the responsibility to migrate a website with multiple applications to another server. That migration went well (all applications working). However, the performance of that new server was sub par (whole other story). We decided to migrate it again. This time everything is working very [...] read more
I'm setting up a new asp.net site on IIS8 (windows server 2012). I'm trying to take older code that works on windows server 2008, IIS6. Both are virtual servers. Windows authentication is enabled. Anonymous Authentication is disabled. (tried enabling per some post I read but no change) Getting the user [...] read more
The following code works fine on my dev PC but crashes when deployed to the server: using System.DirectoryServices.AccountManagement; using (var ctx = new PrincipalContext(ContextType.Domain, domainName)) using (GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx, IdentityType.Name, groupName)) { if (grp == null) return new string[0]; return grp.GetMembers(true).Select(m => m.SamAccountName).ToArray(); } The crash is as follows: [...] read more
Apologies for duplicate of System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred but I can't comment yet and there's no answer. The solution from this question, did not work. Error on publishing: System.DirectoryServices.DirectoryServicesCOMException I've got a new ASP.NET MVC 3 web application project with Razor view engine in Visual Studio 2010. It is [...] read more
I have web app written in .NET 2.0 hosted under IIS 6.0 with integrated authorization enabled. I moved this app to Windows Server 2008 R2 with IIS 7.5 with Windows auth enabled, and now I am getting this error. Any help? > Security Exception > > Description: The application attempted [...] read more
So I have a hosting domain that's currently running my App on IIS 7, Application Pool Settings: * Identity: Network Service * Managed Pipeline Mode: Integrated * .NET Version: v4.0 * Name: .NET v4.5 IIS Authentication settings: * Anonymous: Disabled * Impersonation: Enabled * Forms: Disabled * Windows: Enabled There [...] read more
Trying to troubleshoot a bug with user creation based on AD credentials and I'm getting the above exception, but because of access restrictions my available information is somewhat limited to logfiles. I know this is a permissions issue, but all the suggestions I've found have produced no different results. This [...] read more
I am trying to search AD for a user, but it keeps throwing an exception. The application is setup to use AppPool. and I am certain that the logged in user has access to search AD. Code: public static UserADInfoModel ResolveUserProperties(string sam) { UserADInfoModel uad = new UserADInfoModel(); PrincipalContext DC [...] read more
Following problem: i'm trying to add a computer to an Active Directory group via ASP.NET & C# for a little rollout tool. But as soon as i upload it on my server (IIS 8.5) the trouble starts. Everything like search for computers and groups works perfectly fine, but adding new [...] read more
I'm stumped by this issue. I've written a powershell script which I'm trying to use to import a GPO across multiple domains and then link it with new-gplink. I've made sure all servers have GP Powershell module installed and it's been working pretty well so far, however the issue I'm [...] read more
I have looked at every posting regarding the reasons for the following exception: > An unhandled exception has occurred. > at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) > at System.DirectoryServices.DirectoryEntry.Bind() > at System.DirectoryServices.DirectoryEntry.get_AdsObject() > at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) > at System.DirectoryServices.DirectorySearcher.FindOne() It appears that the best solution for this issue is to use HostingEnvironment.Impersonate() when [...] read more
I want to create a directory intranet web site using Active Directory for our company. I got this so far, but when I run in debug mode the code breaks in searchResultCollection....search.findAll(); displaying: > [DirectoryServicesCOMException (0x80072020): An operations error occurred.] I have tried changing the IIS asp.net impersonation to enabled [...] read more
We are a team where everyone of us experience this somewhat random error. The error is listed below and appears on the line: UserPrincipal.FindByIdentity(principalContext, windowsPrincipal.Identity.Name); It works just fine several days/weeks/months, and then one of us get this error. On our test server, where we do not deploy changes to [...] read more
I have an asp.net application that uses delegation to perform actions on the Active Directory as the authenticating user. The application works perfectly on some computers and doesn't work at all on other computers, on these other computers they receive a COMexception error code 0x80072020 the stack trace is: System.Runtime.InteropServices.COMException [...] read more
My scenario looks like this: Java opens a Powershell in which Exchange Powershell Command/Scripts should be executed as a different user and the output should be displayed in the Powershell windows that Java opened (so Java can read the output). So: Normal Powershell --> Add Exchange functionality --> Execute Script/Command [...] read more
I'm trying to query AD in an ASP.Net (4.0) application that is running on Windows Server 2008 R2 (IIS7 installed). In runs fine on my local computer (Windows 7), but not on the server. I'm trying to get the userid of the current user. I've looked at Q&A of similar [...] read more
I am trying to create a intranet website which can look up a users email address based on their Active Directory username. I have the following in my web.config: <authentication mode="Windows"/> <identity impersonate="true"/> And I can obtain the the users UserName with: Environment.UserName Running on localhost, the following code allows [...] read more
I have the following code: <appSettings> <add key="rootDN" value="LDAP://[The rest of the path]"/> </appSettings> string rootDN = System.Configuration.ConfigurationManager.AppSettings["rootDN"]; object ou = Marshal.BindToMoniker(rootDN); This is producing an error: > Unhandled Exception: System.Runtime.InteropServices.COMException (0x80072020): > A n operations error occurred. (Exception from HRESULT: 0x80072020) at > System.Runtime.InteropServices.Marshal.MkParseDisplayName(IBindCtx pbc, St > ring szUserName, [...] read more
I'm trying to use System.DirectoryServices to query an Active Directory server, using LDAP. My code can (apparently) connect and authenticate, but when my first DirectorySearcher FindAll() method is called, I only get: [DirectoryServicesCOMException (0x80072020): An operations error occurred.] Picking apart the exception in the debugger has been remarkably unproductive. It [...] read more
adding more info on @serialhobbyist's request hi all. we're (= me and my colleagues) using PrincipalContext from System.DirectoryServices.AccountManagement to retrieve some authentication info (make sure a user belongs to a group etc). Important: our client is a service running as LocalSystem. this does not happen when we run in a [...] read more
I am trying to run a script remotely (via vRO - essentially WinRM invoke), and am running into an issue with getting some commands to run. I have two DCs: PRIDC and SECDC. The command I'm having issues with: $gpDomain = New-Object -Type Microsoft.GroupPolicy.GPDomain It works when run manually on [...] read more
I am running an Active Directory extract via SSIS Script Component and receiving the same error randomly: > Error Code: -1073450910 Error Description: > System.DirectoryServices.DirectoryServicesCOMException (0x80072020): An > operations error occurred. > > at > Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception > e) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 > outputs, Int32[] outputIDs, PipelineBuffer[] buffers) at > Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 > [...] read more
i have a form authentication: <authentication mode="Forms"> </authentication> <authorization> <deny users="?" /> </authorization> I have a page with my login and to check the credential I do: public static bool ValidateCredentials(string sUserName, string sPassword, string sDomain) { PrincipalContext oPrincipalContext = GetPrincipalContext(sDomain); try { return oPrincipalContext.ValidateCredentials(sUserName, sPassword); } catch (Exception ex) [...] read more
I am working on app which should manage custom team structure so when team leaders adds their members I want them to add only login add pull the First name and Last name from AD. It works fine when I run it on local, but I get 500 Internal server [...] read more
I have a login page that verifies credentials with active directory and redirects to the next page. When I run it locally it works perfect, but when I put it out on our webserver it gives an error trying to create the group principal: (System.DirectoryServices.DirectoryServicesCOMException (0x80072020)) I need to find [...] read more
I am trying to create a self service page for our internal users to manage their own file access by adding/removing users from AD security groups. I would like the site to run under the context of the user accessing the page as we already have all of the security [...] read more
I am trying to write a ASP.NET page that looks at group membership for authorization of a site. I have code that is working when run in the local debugger and when locally logged into the web server itself. However, when i try to access the page from a remote [...] read more
I write a very sample test program and run it as local system account in a domain machine. Here is the code look like: static void Main(string[] args) { try { System.Console.Out.WriteLine("Test Start"); List<string> temp = new List<string>(); temp.Add(Environment.UserDomainName); temp.Add("test"); temp.Add("test.com"); temp.Add("dc.test.com"); temp.Add("gc.test.com"); foreach (var i in temp) { using [...] read more
I am doing the c# code to change a ldap user's password by either user himself, or the admin. I can successfully authenticate the users. However, I get the following error message when I try to invoke a ChangePassword or SetPassword behavior: > InnerException: The directory property cannot be found [...] read more
I’m trying to get user details based on group membership from ActiveDirectory. This works on my local machine, but not when I run it on the server. What I don’t understand is that it will return the number of members of the group correctly (although it has to be in [...] read more
I keep getting the following error when trying to run an application in the production environment with "anonymous" authentication and hardcoded username. When I turn on basic authentication, which then prompts for username/password everything works like a charm. but I need to get the hardcoded version to work as well. [...] read more
I've inherited a piece of software that connects to our Open Directory to provide web authentication. When connected to the OD it works like a charm but we want to transition to using Active Directory as our main authentication provider. Obviously there are differences in the LDAP scheme between the [...] read more
I am trying to create a new user and set their password in AD LDS using asp.net vb. I'm binding to an instance of a directory entry, which is working fine. And I can add a user without a problem. The problem is that I can't seem to set the [...] read more
So I have been banging my head on this one. I have a self hosted WCF service: var webServiceHost = new WebServiceHost(helloWorld); webServiceHost.Authorization.ImpersonateCallerForAllOperations = true; var uri = new Uri(BaseUri + webService.UriDirectory); var webHttpBinding = new WebHttpBinding(webHttpSecurityMode); webHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; var sep = webServiceHost.AddServiceEndpoint(IHelloWorld, webHttpBinding, uri); var webHttpBehavior = new [...] read more
The following code works fine in Visual Studio Development enviroment on my local machine. However when I move the files to a Windows 2008 R2 IIS 7.5 machine I get the following error: > [DirectoryServicesCOMException (0x80072020): An operations error occurred. ] > _Default.GetFullName(String strLoginName, String& STR_FIRST_NAME, String& > STR_LAST_NAME, String& [...] read more
We have Dynamics CRM 4 update rollup 6 configured as an IFD and have set the UserRootPath using the deployment configuration tool. Adding users through the CRM interface works perfectly. However, when trying to add a user through the CrmService API, the user is not added and we get the [...] read more
I am receiving an error a web based application that allows corporate intranet users to update their active directory details (phone numbers, etc). The web application is hosted on IIS6 running Windows Server 2003 (SP1). The IIS website is using NTLM Authentication and the website has integrated security enabled. The [...] read more
I have been tasked with migrating some c# v4 apps from one server to another, and I have hit an issue with one of the aspx forms. The form has the a call to a class to search for an AD user in its code behind file. The method it [...] read more
I'm building a windows service that polls a windows file share location for a file containing members that may be found in LDAP. The windows service is running as a specific user on the domain to have access to the file share. This user is in the Administrator group both [...] read more