标签: active-directory

从命令行使用ldapsearch查询Windows Active Directory服务器

如果使用ldapsearch,ldapadd,ldapdelete等实用程序查询Active Directory服务器,是否可以让任何人知道?

ldap active-directory openldap

52
推荐指数
1
解决办法
18万
查看次数

如何检查用户是否属于AD组?

起初我认为下面的代码有效,因为如果我将该组作为"IT"它正常运行,因为我的用户名在活动目录中的IT组中.我学到的是,无论我是否在IT组中拥有我的用户名,它总是返回,如果我将其更改为我所在的任何其他组,则返回始终返回false.任何帮助,将不胜感激.

    private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
    {
        // tab control security for admin tab
        bool admin = checkGroup("IT");

        if ((admin == true) && (tabControl1.SelectedTab == tpHistory))
        {
            tabControl1.SelectedTab = tpHistory;
        }
        else if ((admin == false) && (tabControl1.SelectedTab == tpHistory))
        {
            tabControl1.SelectedTab = tpRequests;
            MessageBox.Show("Unable to load tab. You have insufficient privileges.",
                "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }
    }

    // check active directory to see if user is in Marketing department group
    private static bool checkGroup(string group)
    {
        WindowsIdentity identity …
Run Code Online (Sandbox Code Playgroud)

.net c# active-directory winforms c#-4.0

51
推荐指数
2
解决办法
8万
查看次数

Powershell v3.0管道问题

我遇到这个命令有问题:

gc .\domains.txt | Get-ADDomain
Run Code Online (Sandbox Code Playgroud)

顾名思义,domains.txt包含要查询的Active Directory列表(所有域都在同一个林中).

If I run it on my Windows 8 machine everything works fine and I get the expected results, instead on a Windows 2008 R2 SP1 member server (not a DC) with WMF 3.0 I get result only from the first domain in the list and for the others:

Get-ADDomain : A referral was returned from the server
Run Code Online (Sandbox Code Playgroud)

If I query a domain in the list with:

Get-ADDomain <Domain name here>
Run Code Online (Sandbox Code Playgroud)

it works fine. …

powershell active-directory powershell-3.0

51
推荐指数
1
解决办法
1629
查看次数

如何在运行PowerShell脚本后保持shell窗口打开?

我有一个非常短的PowerShell脚本连接到服务器并导入AD模块.我想通过双击来运行脚本,但我担心窗口会在最后一行后立即关闭.

我该如何解决这个问题?

active-directory powershell-2.0

47
推荐指数
3
解决办法
7万
查看次数

内置帮助程序将User.Identity.Name解析为Domain\Username

是否有任何内置的实用程序或帮助程序来解析HttpContext.Current.User.Identity.Name,例如domain\user,如果存在和用户单独获取域名?

或者还有其他课程吗?

我知道这很容易打电话String.Split("\")但很有意思

.net c# asp.net authentication active-directory

46
推荐指数
4
解决办法
4万
查看次数

查看用户是否是C#+ Asp.net中Active Directory组的一部分

我需要一种方法来查看用户是否是我的.Net 3.5 asp.net c#应用程序中的活动目录组的一部分.

我正在使用msdn的标准ldap身份验证示例,但我真的没有看到如何检查组.

c# asp.net active-directory active-directory-group .net-3.5

46
推荐指数
7
解决办法
8万
查看次数

LDAP通过Ruby或Rails

我一直试图将Rails应用程序挂钩到ActiveDirectory.我将同步AD和数据库之间的用户数据,目前是MySQL(但可能会变成SQL Server或PostgreSQL).

我已经检查了activedirectory-ruby,它看起来真的很麻烦(1.0发布!?).它包装了Net :: LDAP,所以我尝试使用它,但它非常接近LDAP的实际语法,并且我喜欢ActiveDirectory-Ruby的抽象,因为它具有类似ActiveRecord的语法.

是否有一个优雅的ORM类型的目录服务器工具?更好的是,如果有一些用于LDAP的脚手架工具(用户,组,组织单位等的CRUD).然后,我可以通过Authlogic快速将其与我现有的身份验证代码集成,并保持所有数据同步.

ruby ldap ruby-on-rails active-directory

44
推荐指数
2
解决办法
3万
查看次数

ldap嵌套组成员资格

是否可以创建一个LDAP查询,该查询将返回(或检查)嵌套组中的用户?例如,UserA是GroupA的成员,GroupA是GroupB的成员.我希望GroupB上的查询返回UserA是一个成员.仅限LDAP.服务器是Active Directory.

nested ldap active-directory

44
推荐指数
3
解决办法
6万
查看次数

通过LDAP连接到Active Directory

我想用C#连接到我们的本地Active Directory.

我发现这篇文章很好.

但我真的不知道如何通过LDAP连接.

有人可以解释如何使用询问的参数吗?

示例代码:

  static DirectoryEntry createDirectoryEntry()  
  {  
     // create and return new LDAP connection with desired settings  

     DirectoryEntry ldapConnection     = new DirectoryEntry("rizzo.leeds-art.ac.uk");  
     ldapConnection.Path               = "LDAP://OU=staffusers,DC=leeds-art,DC=ac,DC=uk";  
     ldapConnection.AuthenticationType = AuthenticationTypes.Secure;  
     return ldapConnection;  
  }  
Run Code Online (Sandbox Code Playgroud)

我只有Active Directory服务器的主机名和IP地址.什么DC=xxx,DC=xx等等意味着什么?

c# active-directory

44
推荐指数
1
解决办法
14万
查看次数

在.NET中添加和删除Active Directory组中的用户

我正在编写以下方法来在C#中添加和删除活动目录中的用户.

void AddUserToGroup(string userId, string groupName);
void RemoveUserFromGroup(string userId, string groupName);
Run Code Online (Sandbox Code Playgroud)

如何最好地实现这些方法?

以下是CodeProject的一些代码.我在这些示例中看不到AD服务器的位置?(在使用LDAP协议时,它是由.NET框架隐式提供的吗?).这些例子值得关注吗?

public void AddToGroup(string userDn, string groupDn)
{
    try
    {
        DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + groupDn);
        dirEntry.Properties["member"].Add(userDn);
        dirEntry.CommitChanges();
        dirEntry.Close();
    }
    catch (System.DirectoryServices.DirectoryServicesCOMException E)
    {
        //doSomething with E.Message.ToString();

    }
}


public void RemoveUserFromGroup(string userDn, string groupDn)
{
    try
    {
        DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + groupDn);
        dirEntry.Properties["member"].Remove(userDn);
        dirEntry.CommitChanges();
        dirEntry.Close();
    }
    catch (System.DirectoryServices.DirectoryServicesCOMException E)
    {
        //doSomething with E.Message.ToString();

    }
}
Run Code Online (Sandbox Code Playgroud)

.net c# ldap active-directory active-directory-group

42
推荐指数
2
解决办法
7万
查看次数