2016-07-14 2 views
1

私は次のチュートリアル使用して、Windows AzureのセキュアLDAPを設定している:AzureのLDAP「サーバが動作していない」というエラーC#の

https://azure.microsoft.com/en-us/documentation/articles/active-directory-ds-admin-guide-configure-secure-ldap/

をしかし、私は、「サーバーが動作していない」というエラーを取得しています。私は、次のコードを使用しようとしています:私も私のIPとドメインはLDP.EXEソフトウェアで、それはまた、エラーを与えている接続しようとしてい

string DomainPath = "LDAP://0.0.0.0:636"; 
DirectoryEntry searchRoot = new DirectoryEntry(DomainPath, "[email protected]example.com", "password", AuthenticationTypes.Secure); 
DirectorySearcher search = new DirectorySearcher(searchRoot); 
search.Filter = "(&(objectClass=user)(objectCategory=person))"; 
search.PropertiesToLoad.Add("samaccountname"); 
search.PropertiesToLoad.Add("mail"); 
search.PropertiesToLoad.Add("usergroup"); 
search.PropertiesToLoad.Add("displayname");//first name 
SearchResult result; 
SearchResultCollection resultCol = search.FindAll(); 
if (resultCol != null) 
{ 
    for (int counter = 0; counter < resultCol.Count; counter++) 
    { 
     string UserNameEmailString = string.Empty; 
     result = resultCol[counter]; 
     if (result.Properties.Contains("samaccountname") && result.Properties.Contains("mail") && 
           result.Properties.Contains("displayname")) 
     { 
      Users objSurveyUsers = new Users(); 
      objSurveyUsers.Email = (String)result.Properties["mail"][0] + 
            "^" + (String)result.Properties["displayname"][0]; 
      objSurveyUsers.UserName = (String)result.Properties["samaccountname"][0]; 
      objSurveyUsers.DisplayName = (String)result.Properties["displayname"][0]; 
      lstADUsers.Add(objSurveyUsers); 
     } 
    } 
} 

を接続に失敗しました。

私の質問は、私は空白のプラットフォームでDirectoryEntryを使用してユーザーを取得できますか?

もしそうでなければ、AzureのLDAPの目的は何ですか?アドバンスアズール、アズールのADからユーザーを取得することがベストプラクティスと途中で

+0

問題を解決しましたか?私は同じ問題を抱えています。あなたがそれを解決した場合は、私に情報を教えてください。 AzureのLDAPの目的は何ですか? – Rango

答えて

0

おかげでのAzure ADグラフAPIを使用している、それを知るためにoverviewを参照してください。

REST & SDKを含むAADグラフAPIを使用するには2通りの方法があります。

参考資料として、グラフAPIを使用するユーザーの操作方法と、さまざまなプログラミング言語用のサンプルコードの提供方法について紹介しています(https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operationsを参照してください)。

関連する問題