1. <i id='rxZys'><tr id='rxZys'><dt id='rxZys'><q id='rxZys'><span id='rxZys'><b id='rxZys'><form id='rxZys'><ins id='rxZys'></ins><ul id='rxZys'></ul><sub id='rxZys'></sub></form><legend id='rxZys'></legend><bdo id='rxZys'><pre id='rxZys'><center id='rxZys'></center></pre></bdo></b><th id='rxZys'></th></span></q></dt></tr></i><div id='rxZys'><tfoot id='rxZys'></tfoot><dl id='rxZys'><fieldset id='rxZys'></fieldset></dl></div>
      <tfoot id='rxZys'></tfoot>
    2. <legend id='rxZys'><style id='rxZys'><dir id='rxZys'><q id='rxZys'></q></dir></style></legend>
        <bdo id='rxZys'></bdo><ul id='rxZys'></ul>

        <small id='rxZys'></small><noframes id='rxZys'>

      1. 如何在 Active Directory 中找到具有 GUID(objectGUID) 参数的用户

        How I can find a User with the GUID(objectGUID) Parameter in Active Directory(如何在 Active Directory 中找到具有 GUID(objectGUID) 参数的用户)
      2. <i id='lPXik'><tr id='lPXik'><dt id='lPXik'><q id='lPXik'><span id='lPXik'><b id='lPXik'><form id='lPXik'><ins id='lPXik'></ins><ul id='lPXik'></ul><sub id='lPXik'></sub></form><legend id='lPXik'></legend><bdo id='lPXik'><pre id='lPXik'><center id='lPXik'></center></pre></bdo></b><th id='lPXik'></th></span></q></dt></tr></i><div id='lPXik'><tfoot id='lPXik'></tfoot><dl id='lPXik'><fieldset id='lPXik'></fieldset></dl></div>
          <tbody id='lPXik'></tbody>

        <small id='lPXik'></small><noframes id='lPXik'>

          <bdo id='lPXik'></bdo><ul id='lPXik'></ul>

                <legend id='lPXik'><style id='lPXik'><dir id='lPXik'><q id='lPXik'></q></dir></style></legend>
                <tfoot id='lPXik'></tfoot>
                • 本文介绍了如何在 Active Directory 中找到具有 GUID(objectGUID) 参数的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的 ASP.NET 应用程序中,我从 Active Directory 获取信息.我必须使用 GUID 信息获取有关用户的信息(例如:a28a6a34dsfdsf57d9e54f945a241),但我不知道如何正确使用过滤器进行此搜索:/

                  In my ASP.NET Application I get Informations from Active Directory. I must get Informations about a User with the GUID Informations (example: a28a6a34dsfdsf57d9e54f945a241) but I don't know how I can use the filter right for this search :/

                  例如,如果我搜索用户姓氏:

                  for example if I search to a User Lastname:

                  DirectoryEntry Entry = new DirectoryEntry("LDAP://" + "Domain");
                  
                              string filter = "(&(objectClass=user)(objectCategory=person)(cn=" + txtBenutzer.Text + "*))";
                  
                              DirectorySearcher Searcher = new DirectorySearcher(Entry, filter);
                  
                              var q = from s in Searcher.FindAll().OfType<SearchResult>()
                                      select new
                                      {
                                          //GetProperty(s, "objectGUID"),
                                          Benutzer = GetProperty(s, "sAMAccountName"),
                                          eMail = GetProperty(s, "mail"),
                                          Vorname = GetProperty(s, "givenName"),
                                          Nachname = GetProperty(s, "sn"),
                                          Telefon = GetProperty(s, "telephoneNumber"),
                                          UserID = s.GetDirectoryEntry().NativeGuid
                  
                                      };
                  
                              this.myListView.DataSource = q;
                              this.myListView.DataBind();
                  

                  现在我需要一个带有 GUID 的过滤器,我可以在 AD 中找到唯一的用户.这个搜索的 GUID 我在一个字符串中 UserID = Session["UserID"].toString()

                  now I need a filter with the GUID that I can find the one and only user in AD. The GUID for this Search I have in a string UserID = Session["UserID"].toString()

                  塔拉索夫

                  推荐答案

                  不需要搜索,知道GUID就可以直接绑定对象,例如

                  You don't need to search, you can bind directly to the object if you know the GUID, e.g.

                  var user = new DirectoryEntry("LDAP://<GUID=119d0d80-699d-4e81-8e4e-5477e22ac1b3>");
                  

                  (替换为您的实际 ObjectGUID).

                  (replace with your actual ObjectGUID).

                  检查此 MSDN 条目:使用 ObjectGUID 绑定到一个对象

                  Check this MSDN entry: Using ObjectGUID to Bind to an Object

                  这篇关于如何在 Active Directory 中找到具有 GUID(objectGUID) 参数的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding and removing users from Active Directory groups in .NET(在 .NET 中的 Active Directory 组中添加和删除用户)
                  set equality in linq(在 linq 中设置相等)
                  HashSet conversion to List(HashSet 转换为 List)
                  How to set timeout for webBrowser navigate event(如何为 webBrowser 导航事件设置超时)
                  Test whether two IEnumerablelt;Tgt; have the same values with the same frequencies(测试两个IEnumerablelt;Tgt;具有相同频率的相同值)
                  How do you determine if two HashSets are equal (by value, not by reference)?(您如何确定两个 HashSet 是否相等(按值,而不是按引用)?)
                • <tfoot id='D60Mw'></tfoot>

                      <tbody id='D60Mw'></tbody>

                    <small id='D60Mw'></small><noframes id='D60Mw'>

                      <bdo id='D60Mw'></bdo><ul id='D60Mw'></ul>

                        <i id='D60Mw'><tr id='D60Mw'><dt id='D60Mw'><q id='D60Mw'><span id='D60Mw'><b id='D60Mw'><form id='D60Mw'><ins id='D60Mw'></ins><ul id='D60Mw'></ul><sub id='D60Mw'></sub></form><legend id='D60Mw'></legend><bdo id='D60Mw'><pre id='D60Mw'><center id='D60Mw'></center></pre></bdo></b><th id='D60Mw'></th></span></q></dt></tr></i><div id='D60Mw'><tfoot id='D60Mw'></tfoot><dl id='D60Mw'><fieldset id='D60Mw'></fieldset></dl></div>
                        <legend id='D60Mw'><style id='D60Mw'><dir id='D60Mw'><q id='D60Mw'></q></dir></style></legend>