I am trying the C# sample EnumerateMembership. When I run the sample, the following error is generated
Generic Exception Handler: System.Runtime.InteropServices.COMException (0x800414
52): Unknown error (0x80041452)
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_Name()
at ActiveRoleTest.EnumerateMembership.Main(String[] args) in c:\temp\activero
letest\enumeratemembership.cs:line 22
Any suggestion?
Code
---------------
using System;
using System.DirectoryServices;
using ActiveDs;
using EDMLib;
namespace EnumerateMemberships
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
string strUserADsPath = "EDMS://cn=UserName,ou=....";
DirectoryEntry oUser = new DirectoryEntry(strUserADsPath);
Console.WriteLine("Groups to which belongs:"+ oUser.Name);
// Invoke IADsUser::Groups method.
IADsMembers groups = oUser.Invoke("Groups") as IADsMembers;
foreach ( object group in groups)
{
// Get the Directory Entry.
DirectoryEntry groupEntry = new DirectoryEntry(group);
Console.WriteLine(groupEntry.Name);
}
}
}
}
- Products
- View all products
- Free trials
- Privileged Access Management
- Overview
- PAM Essentials
- Safeguard
- Safeguard On Demand
- Safeguard for Privileged Analytics
- Safeguard for Privileged Passwords
- Safeguard for Privileged Sessions
- Safeguard Remote Access
-
Endpoint Privilege Management
- Privilege Manager for Windows
- Privilege Manager for Unix
- Safeguard Authentication Services
- Safeguard for Sudo
- Access Management
- Identity Governance and Administration
- Active Directory Management
- Log Management
- Solutions
- Resources
- Trials
- Support
- Partners
- Communities