{"id":193,"date":"2009-03-25T14:01:00","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/www.yazilimmutfagi.com\/?p=193"},"modified":"2009-03-25T14:01:00","modified_gmt":"1970-01-01T00:00:00","slug":"active-directory-nedir-active-directorye-baglanmak-ve-active-directory-icinde-arama-yapmak","status":"publish","type":"post","link":"https:\/\/www.yazilimmutfagi.com\/index.php\/2009\/03\/25\/active-directory-nedir-active-directorye-baglanmak-ve-active-directory-icinde-arama-yapmak\/","title":{"rendered":"Active Directory nedir, Active Directorye Baglanmak ve Active Directory i\u00e7inde Arama Yapmak"},"content":{"rendered":"<h1 style=\"margin: 24pt 0cm 0pt;\"><span style=\"color: windowtext;\"><span style=\"font-size: large;\"><span style=\"font-family: Cambria;\">Active Directory nedir?<br style=\"\" \/>\n<br style=\"\" \/>\n<\/span><\/span><\/span><\/h1>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;\"><span style=\"font-size: 10pt; color: rgb(51, 51, 51); line-height: 115%; font-family: 'Verdana','sans-serif';\">Active Directory, ag &uuml;zerinde bulunan t&uuml;m bilgilerin (&ouml;rnegin kullanicilar, gruplar , bilgisayarlar vb.) depolanmasini saglayan ve bu bilgilerin kullanicilar ve y&ouml;neticiler tarafindan kolayca kullanilmasini ve bulunmasini saglayan bir servistir. Ayrica g&uuml;venlik, oturum a&ccedil;ma sirasinda kimlik denetimi gibi islemlerde Active Directory ile b&uuml;t&uuml;nlesik olarak &ccedil;alismaktadir. <\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;\"><span style=\"font-size: 10pt; color: rgb(51, 51, 51); line-height: 115%; font-family: 'Verdana','sans-serif';\">Active Directory ile .NET ile yaptigimiz uygulamalari entegre edebilir ve sistemdeki bilgilere read\/write hakki ile ulasabiliriz. Verdigimiz haklar dogrultusunda bilgiler &uuml;zerinde degisiklikler uygulayabiliriz.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;\"><span style=\"font-size: 10pt; color: rgb(51, 51, 51); line-height: 115%; font-family: 'Verdana','sans-serif';\">Makalemdeki bu &ouml;rneklerde C# dili kullanilmistir.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;\"><strong style=\"\"><span style=\"font-size: 10pt; color: rgb(51, 51, 51); line-height: 115%; font-family: 'Verdana','sans-serif';\">Eklenecek Namespaceler<\/span><\/strong><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;\"><span style=\"font-size: 10pt; color: rgb(51, 51, 51); line-height: 115%; font-family: 'Verdana','sans-serif';\">&Ouml;ncelikle Aktive Directory&rsquo;ye ulasmak i&ccedil;in asagidaki dizin servislerini (namespaceleri) eklememiz gerekmektedir. Ayrica Projenizde Add Referance diyip .NET tabi altindaki <\/span><span style=\"font-size: 10pt; line-height: 115%; font-family: 'Courier New';\">System.DirectoryServices&rsquo;i <\/span><span style=\"font-size: 10pt; color: rgb(51, 51, 51); line-height: 115%; font-family: 'Verdana','sans-serif';\">eklemeniz gerekiyor.<\/span><span style=\"font-size: 10pt; color: blue; line-height: 115%; font-family: 'Courier New';\"><br style=\"\" \/>\n<\/span><a href='www.yazilimmutfagi.com'>.<\/a><\/p>\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"MsoTableGrid\" style=\"border: medium none ; margin: auto auto auto 5.4pt; background: rgb(238, 236, 225) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; border-collapse: collapse;\">\n    <tbody>\n        <tr style=\"\">\n            <td width=\"614\" valign=\"top\" style=\"border: medium none rgb(240, 240, 240); padding: 0cm 5.4pt; width: 460.6pt; background-color: transparent;\">\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: blue; font-family: 'Courier New';\">using<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> System.DirectoryServices;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: blue; font-family: 'Courier New';\">using<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> System.DirectoryServices.ActiveDirectory;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: blue; font-family: 'Courier New';\">using<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> System.DirectoryServices.AccountManagement;<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;\"><strong style=\"\"><span style=\"font-size: 10pt; line-height: 115%; font-family: 'Verdana','sans-serif';\"><br \/>\nBaglanti<\/span><\/strong><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;\"><span style=\"font-size: 10pt; line-height: 115%; font-family: 'Verdana','sans-serif';\">Aktive Directory ile kurulacak olan LDAP baglantisini domain adi girilerek saglanabilir,asagidaki &ouml;rnekte yazilimmutfagi.com domainine baglantisi &ouml;rneklendirilmistir. Bu baglantiyi Windows authentication ile saglanir. Yani budurumda baglantinin g&uuml;venli ve DC&rsquo;lere ulasiyor olmasi gerekir. Istendigi taktirde kullanici adi ve parolada eklenir.<\/span><\/p>\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"MsoTableGrid\" style=\"border: medium none ; margin: auto auto auto 5.4pt; background: rgb(238, 236, 225) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; border-collapse: collapse;\">\n    <tbody>\n        <tr style=\"\">\n            <td width=\"614\" valign=\"top\" style=\"border: medium none rgb(240, 240, 240); padding: 0cm 5.4pt; width: 460.6pt; background-color: transparent;\">\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: rgb(43, 145, 175); font-family: 'Courier New';\">DirectoryEntry<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> ldapConnection = <span style=\"color: blue;\">new<\/span> <span style=\"color: rgb(43, 145, 175);\">DirectoryEntry<\/span>();<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">ldapConnection.Path = <span style=\"color: rgb(163, 21, 21);\">&quot;LDAP:\/\/ dc=yazilimmutfagi,dc=com&quot;<\/span>;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&nbsp;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: green; font-family: 'Courier New';\">\/\/yada<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: green; font-family: 'Courier New';\">&nbsp;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: rgb(43, 145, 175); font-family: 'Courier New';\">DirectoryEntry<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> domain = <span style=\"color: blue;\">new<\/span> <span style=\"color: rgb(43, 145, 175);\">DirectoryEntry<\/span>(<span style=\"color: rgb(163, 21, 21);\">&quot;LDAP:\/\/DC=dcadresi,DC=intra&quot;<\/span>);<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Seklinde yazilabilir.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><strong style=\"\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Active Directory i&ccedil;inde Arama<\/span><\/strong><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><strong style=\"\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">&nbsp;<\/span><\/strong><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Active Directory i&ccedil;inde bulunan nesne &ouml;zelliklerine ve sahip olduklari degerlere ulasmak m&uuml;mk&uuml;nd&uuml;r.<span style=\"\">&nbsp; <\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Asagidaki kodda yeni bir directory searcher olusturulmus ve bilgisayar nesnelerine g&ouml;re filtrelenmistir, daha sonra t&uuml;m sonu&ccedil;lar results collectionuna aktarilmistir. Yani bilgisayar nesnelerine g&ouml;re arama sonucunda result, domiande olan t&uuml;m bilgisayarlari tutmaktadir.<br style=\"\" \/>\n<\/span><a href='www.yazilimmutfagi.com'>.<\/a><\/p>\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"MsoTableGrid\" style=\"border: medium none ; margin: auto auto auto 5.4pt; background: rgb(238, 236, 225) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; border-collapse: collapse;\">\n    <tbody>\n        <tr style=\"\">\n            <td width=\"614\" valign=\"top\" style=\"border: medium none rgb(240, 240, 240); padding: 0cm 5.4pt; width: 460.6pt; background-color: transparent;\">\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&hellip;&hellip;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: rgb(43, 145, 175); font-family: 'Courier New';\">DirectorySearcher<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> search = <span style=\"color: blue;\">new<\/span> <span style=\"color: rgb(43, 145, 175);\">DirectorySearcher<\/span>(domain);<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">search.Filter = <span style=\"color: rgb(163, 21, 21);\">&quot;(&amp;ObjectCategory=computer)&quot;<\/span>;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: rgb(43, 145, 175); font-family: 'Courier New';\">SearchResultCollection<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> results = search.FindAll();<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm -1cm 0pt 0cm; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&hellip;&hellip;<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\"><br \/>\nEger arama kriterlerimizi daha belirgin bir sekilde yapmak istersek;<br style=\"\" \/>\n<br style=\"\" \/>\n<\/span><\/p>\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"MsoTableGrid\" style=\"border: medium none ; margin: auto auto auto 5.4pt; background: rgb(238, 236, 225) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; border-collapse: collapse;\">\n    <tbody>\n        <tr style=\"\">\n            <td width=\"614\" valign=\"top\" style=\"border: medium none rgb(240, 240, 240); padding: 0cm 5.4pt; width: 460.6pt; background-color: transparent;\">\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&hellip;&hellip;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: blue; font-family: 'Courier New';\">string<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> groupName = txtGroupName.Text.ToString();<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: rgb(43, 145, 175); font-family: 'Courier New';\">SearchResult<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> result;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; color: rgb(43, 145, 175); font-family: 'Courier New';\">DirectorySearcher<\/span><span style=\"font-size: 10pt; font-family: 'Courier New';\"> search = <span style=\"color: blue;\">new<\/span> <span style=\"color: rgb(43, 145, 175);\">DirectorySearcher<\/span>();<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">search.Filter = <span style=\"color: rgb(43, 145, 175);\">String<\/span>.Format(<span style=\"color: rgb(163, 21, 21);\">&quot;(cn={0})&quot;<\/span>, groupName);<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">search.PropertiesToLoad.Add(<span style=\"color: rgb(163, 21, 21);\">&quot;member&quot;<\/span>);<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">search.PropertiesToLoad.Add(<span style=\"color: rgb(163, 21, 21);\">&quot;Description&quot;<\/span>);<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&hellip;&hellip;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&hellip;&hellip;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&hellip;&hellip;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">&nbsp;<\/span><\/p>\n            <p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Courier New';\">result = search.FindOne();<\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Bu kod par&ccedil;asinda aramamizi disaridan aldigimiz gurup adina g&ouml;re yapmaktayiz.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Geri kalan kisimlar elde ettigimiz datayi herhangi bi listbox&rsquo;a, excele, vb. ekleme-&ccedil;ikarma islemleridir.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Kolay gelsin&hellip;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 0pt; line-height: normal;\"><span style=\"font-size: 10pt; font-family: 'Verdana','sans-serif';\">Mehmet Serkan &Ouml;ZGEN<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>Active Directory, ag &#252;zerinde bulunan t&#252;m bilgilerin (&#246;rnegin kullanicilar, gruplar , bilgisayarlar vb.) depolanmasini saglayan ve bu bilgilerin kullanicilar ve y&#246;neticiler tarafindan kolayca kullanilmasini ve bulunmasini saglayan bir servistir. Ayrica g&#252;venlik, oturum a&#231;ma sirasinda kimlik denetimi<\/p>\n","protected":false},"author":542,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[407],"tags":[5148,5125,4374,4400],"_links":{"self":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts\/193"}],"collection":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/users\/542"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":0,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}