'ADSI'에 해당되는 글 5건

  1. 2008/04/22 ADSI를 이용해 속성값을 쓸때 생기는 0x8000500D 에러 (4)
  2. 2007/11/09 Windows Scripting를 이용해 AD에 LDAP과 ADSI를 이용한 사용자 추가
  3. 2007/09/06 Active directory how to
  4. 2007/09/06 Active Directory ㅠ_ㅠ
  5. 2007/09/05 Active directory 제어
2008/04/22 11:48

ADSI를 이용해 속성값을 쓸때 생기는 0x8000500D 에러



이 문제는 ADSI를 이용해 Active Directory 속성값에 접근할 때 생깁니다.


이런 에러가 나는 주요 원인은 Exchange 등의 AD Schema가 확장되어있던 위치에서 작성된 코드를 확장되지 않은 AD에 실행하게되면 이와 같이 확장속성이 없는데 접근하려 하여서 에러가나는 경우를 확인 하엿습니다. 이런 경우 E_ADS_PROPERTY_NOT_FOUND 메시지를 보내고 이 코드값으로 0x8000500D을 반환하게 됩니다.


HTTP/1.1 200 OK
Via: 1.1 DHCP
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 52
Date: Wed, 16 Apr 2008 07:50:32 GMT
Content-Type: text/xml; charset=euc-kr
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
 
<DATA>예외가 발생한 HRESULT: 0x8000500D</DATA>

자세한 내용은 아래 Microsoft 기술문서 167695번을 확인하세요

 PRB: Exception 0x8000500D When Querying a Property Using ADSI

크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 4

Trackback : http://i-ruru.com/trackback/321 관련글 쓰기

  1. Favicon of http://dooji.tistory.com BlogIcon 두지 2008/07/07 16:25 address edit & del reply

    안녕하세요. ADSI 검색하다가 여기까지 왔네요. 혹시 계속 글 올리실 것인지요?
    LDAP과 ASP 관련해서도요?

    • Favicon of http://ruru.tistory.com BlogIcon 써니루루 2008/07/14 17:05 address edit & del

      죄송하지만 ASP에 대해서는 제가 지식이 부족해서 올릴만한 능력이 안되네요 ㅎㅎ
      ADSI에 관해서는 관련 내용을 전문적으로 집대성하지는 않고 제가 문제상황을 보게되면 조금씩 정리하게 될것같습니다.

  2. Favicon of http://dooji.tistory.com BlogIcon 두지 2008/07/14 18:06 address edit & del reply

    ^^ 어찌어찌 해서 해결했습니다. 감사합니다. 좋은 글 많이 올려주세요.

2007/11/09 21:43

Windows Scripting를 이용해 AD에 LDAP과 ADSI를 이용한 사용자 추가

Windows Scripting과 ADSI 인터페이스를 이용해 LDAP 프로토콜을 이용하여 AD에 사용자를 추가하는 간단한 코드를 다음과 같이 수행해 보았다.

Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _
 objRootDSE.Get("defaultNamingContext"))

For i = 1 To 1000
 Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
 objLeaf.Put "sAMAccountName", "UserNo" & i
 objLeaf.SetInfo
Next

Wscript.Echo "1000 Users created."




 

실행 :

cmd> cscript Add1000Account.vbs



참고주소 : http://www.microsoft.com/technet/scriptcenter/guide/sas_ads_overview.mspx?mfr=true

이와 같은 스크립팅을 잘 이용하면 꽤 쓸만한 일을 해낼 수 있을듯 ..

좀 더 연구해 봐야겠다 ;;



2007/09/06 - [.NET/MOSS] - Active Directory ㅠ_ㅠ
2007/09/05 - [.NET/MOSS] - Active directory 제어

크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/186 관련글 쓰기

2007/09/06 16:54

Active directory how to

아 AD, LDAP... 죽일넘들 ㅡㅡ;;


  • How to create a file share using .Net framework
  • How to add a user to file access permissions
  • How to get file security information using DirectoryServices
  • How to get list of groups user is member of
  • How to get list of domains in Active Directory
  • How to get members of a windows group.
  • How to get user SID using DirectoryServices classes
  • How to add a new user account in your machine or domain?
  • How to get full name of logged in user.
  • How to display schema information of Active Directory object using Directory Services in ASP.Net
  • How to use Active Directory classes in ASP.Net to enumerate AD Users
  • How to use Active Directory classes in ASP.Net to enumerate AD Groups
  • How To Enumerate Web Application Directories in IIS Using DirectoryServices




  •  


    In our previous article, How to get full name of logged in user, we showed how you can get full name of a user in a given domain or machine. You can extend that idea to obtain any information you want for a given user. This artcile will describe how you can add a new user account into your domain or machine using .Net DirectoryServices classes. We will be using WinNT provider for illustrations in this article. But you can extend the examples to use LDAP or AD providers.

    Details

    Here are the key steps that you will need to perform to create new account.

    • Create a new DirectoryEntry object and specify the machine name as the path.
    • User accounts are created as nodes corrresponding to User schema class in Active Directory. Therefore we will add a new DirectoryEntry object in Children collection of the machine. The key thing to rememeber will be that when you add new entry, make sure that the schema class name is User.
    • When you add a new node in Children collection, it will return you the newly created object. At this stage the information has not been added to your machine or active directory tree.
    • Now you can set all the values that you need to set for a given account. Following is the list of property names that you can set for the account.
      • UserFlags
      • MaxStorage
      • PasswordAge
      • PasswordExpired
      • LoginHours
      • FullName
      • Description
      • BadPasswordAttempts
      • LastLogin
      • HomeDirectory
      • LoginScript
      • Profile
      • HomeDirDrive
      • Parameters
      • PrimaryGroupID
      • Name
      • MinPasswordLength
      • MaxPasswordAge
      • MinPasswordAge
      • PasswordHistoryLength
      • AutoUnlockInterval
      • LockoutObservationInterval
      • MaxBadPasswordsAllowed
      • RasPermissions
      • objectSid

      For more information on these properties please read Active Directory Services Interface(ADSI) section in Microsoft Platform SDK.

    • You must have noticed from the above list that there is no property to set or get user password value. Operating system does not give access to clear text password value. So we can't expect and property or method to get it. In ADSI, IAdsUser interface provides SetPassword method to set a user's password. This is where Invoke method of DirectoryEntry class comes handy. So we call Invoke to set the password value. The Invoke method can be used to call native methods on underlying active directory objects. There is one important thing to remeber when you set a user's password value. If you are using LDAP provider, then the user account should already have been created in the system by calling CommitChanges or SetInfo method. But WinNT provider does not have this restriction. You can set password value without commiting the changes first.
    • The last step would be to actually create the account in the machine or domain. This is done by calling CommitChanges method on newly added DirectoryEntry object.

    The following code demonstrates all the steps that we described above.

    private void AddUser(string strDoamin, string strLogin, string strPwd)
    {
        DirectoryEntry obDirEntry = null;
        try
        {
            obDirEntry = new DirectoryEntry("WinNT://" + strDoamin);
            DirectoryEntries entries = obDirEntry.Children;
            DirectoryEntry obUser = entries.Add(strLogin, "User");
            obUser.Properties["FullName"].Add("Amigo");
            object obRet = obUser.Invoke("SetPassword", strPwd);
            obUser.CommitChanges();
        }
        catch (Exception ex)
        {
            Trace.Warn(ex.Message);
        }
    }

    Please feel free

    크리에이티브 커먼즈 라이선스
    Creative Commons License

    'Microsoft > SPS/MOSS' 카테고리의 다른 글

    Active Directory를 이용한 Form Authentication의 접근 방향  (0) 2007/09/11
    MOSS Form based authentication  (0) 2007/09/07
    Active directory how to  (0) 2007/09/06
    Active Directory ㅠ_ㅠ  (0) 2007/09/06
    MOSS 테크넷  (0) 2007/09/05
    Active directory 제어  (0) 2007/09/05
    올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


    이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


    Trackback 0 Comment 0

    Trackback : http://i-ruru.com/trackback/161 관련글 쓰기

    2007/09/06 10:40

    Active Directory ㅠ_ㅠ

    이런 그지같은 AD ㅠㅠ

    http://msdn2.microsoft.com/en-us/library/aa772218.aspx
    Active Directory Service Interfaces(ADSI) Reference

    http://msdn2.microsoft.com/en-us/library/aa367008.aspx
    Lightweight Directory Access Protocol(LDAP)




    Active Dirctory를 이용한 경로 정보 전체보기

    //-----------------------------------------------------------------------
    //  This file is part of the Microsoft .NET Framework SDK Code Samples.
    //
    //  Copyright (C) Microsoft Corporation.  All rights reserved.
    //
    //This source code is intended only as a supplement to Microsoft
    //Development Tools and/or on-line documentation.  See these other
    //materials for detailed information regarding Microsoft code samples.
    //
    //THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
    //KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
    //IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
    //PARTICULAR PURPOSE.
    //-----------------------------------------------------------------------

    using System;
    using System.DirectoryServices;
    using System.Security.Permissions;
    using System.Runtime.InteropServices;

    namespace Microsoft.Samples
    {  
        public sealed class ADRead
        {
            private ADRead() {}

            public static void Main(String[] args)
            {
                if(args.Length!=1)
                {
                    Console.WriteLine("Usage: " + Environment.GetCommandLineArgs()[0] + " <ad_path>");
                    Console.WriteLine ();
                    Console.WriteLine ("Press Enter to continue...");
                    Console.ReadLine();
                    return;
                }

                DirectoryEntry objDirEnt=new DirectoryEntry(args[0]);
                Console.WriteLine("Name            = " + objDirEnt.Name);
                Console.WriteLine("Path            = " + objDirEnt.Path);
                Console.WriteLine("SchemaClassName = " + objDirEnt.SchemaClassName);
                Console.WriteLine("");
                Console.WriteLine("Properties:");

                foreach(String Key in objDirEnt.Properties.PropertyNames)
                {
                    Console.Write("\t{0} = ", Key);
                    Console.WriteLine("");
                    foreach(Object objValue in objDirEnt.Properties[Key])
                    {
                        Console.WriteLine("\t\t{0}", objValue);
                    }
                }
            }
        }
    }
    크리에이티브 커먼즈 라이선스
    Creative Commons License

    'Microsoft > SPS/MOSS' 카테고리의 다른 글

    MOSS Form based authentication  (0) 2007/09/07
    Active directory how to  (0) 2007/09/06
    Active Directory ㅠ_ㅠ  (0) 2007/09/06
    MOSS 테크넷  (0) 2007/09/05
    Active directory 제어  (0) 2007/09/05
    MOSS Custom 검색을 위한 Webpart를 만들기 위한 예제 코드  (0) 2007/09/01
    올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


    이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


    Trackback 0 Comment 0

    Trackback : http://i-ruru.com/trackback/160 관련글 쓰기

    2007/09/05 16:04

    Active directory 제어

    http://msdn.microsoft.com/library/kor/default.asp?url=/library/KOR/vbcon/html/vbwlkwalkthroughcreatingadsiobjects.asp


    MOSS.. 아 짜증.. Active directory를 코딩으로 제어해야한다.. 된장..
    크리에이티브 커먼즈 라이선스
    Creative Commons License

    'Microsoft > SPS/MOSS' 카테고리의 다른 글

    Active Directory ㅠ_ㅠ  (0) 2007/09/06
    MOSS 테크넷  (0) 2007/09/05
    Active directory 제어  (0) 2007/09/05
    MOSS Custom 검색을 위한 Webpart를 만들기 위한 예제 코드  (0) 2007/09/01
    MOSS SharePoint Server 2007 SDK  (0) 2007/08/30
    MOSS SmartPart  (0) 2007/08/28
    올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


    이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


    Trackback 0 Comment 0

    Trackback : http://i-ruru.com/trackback/158 관련글 쓰기