[DirectoryServicesCOMException (0x8007052e): Logon failure: unknown user name or bad password. ] System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +439513 System.DirectoryServices.DirectoryEntry.Bind() +36 System.DirectoryServices.DirectoryEntry.get_SchemaEntry() +33
string temp = Environment.GetEnvironmentVariable("USERNAME"); PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "domain.com", "dc=domain, dc=com"); UserPrincipal up = UserPrincipal.FindByIdentity(ctx, IdentityType.SamAccountName, temp); if (up != null) { PrincipalSearchResult<Principal> Results = up.GetAuthorizationGroups(); foreach (Principal Result in Results) { if (Result.Name == "Users") { ClientScript.RegisterStartupScript(typeof(Page), "SymbolError", "<script type='text/javascript'>displayvideo();</script>"); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)