????? ????? ????????? ?? ??? "Active Directory" ???????? Visual C#

?????? ????????? ?????? ?????????
???? ???????: 326091 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

????? ???

???? ??? ??????? ????? ????????? ?? ????????? ?? "Active Directory" ???????? Microsoft Visual C# .NET ?? Microsoft Visual C#. ????? ??? ??????? ??? ????? ????????? ???????? ???? ???? ????? ?????? ????.

??????? ????

????????? ?? ????????? ?? "Active Directory" ? ???? ??????? ???????:
  1. ??? ????? Microsoft Visual Studio .NET ?? Microsoft Visual Studio 2005.
  2. ????? ????? ??????? Visual C# ?? ???? ?????? ?????.

    ?????????? ??? ????? ??? Class1.cs ?? Visual Studio .NET ?? ??? ????? ??? Program.cs ?? Visual Studio 2005.
  3. ???? ??? ??????? ?? ???? ??? ????? ?????.

    ???? ???? ?????? ????? ?????.
  4. ???? ??? System.DirectoryServices.dll.
  5. ???? ??? ????? ??????? COM.
  6. ???? ??? ????? ??? DS ??????.
  7. ???? ??? ????? ?????? System.DirectoryServices ?????? ADSI ??? ??????? ?????? ?? ?????.
  8. ??????? ??? ???? ?? ?????? ???????? ?? Class1.cs ?? ?? ??? Program.cs ???????? ???????? ???????:
    // Use Visual C# .NET to poll for changes to the Active Directory.
    
    using System;
    using System.DirectoryServices;
    using ActiveDs; 
    
    namespace ConsoleApplication1
    {
    	class Class1
    	{
    		[STAThread]
    		static void Main(string[] args)
    		{
    			//TODO: Set UserName, DomainName, and UpperLevelDomain to reflect your environment.
    			PollADObject( "LDAP://cn=UserName,cn=Users,dc=DomainName,dc=UpperLevelDomain" );
    		}
        
    		static void PollADObject(string strUserADSPath )
    		{
    			DirectoryEntry oUser = new DirectoryEntry(strUserADSPath);
    			string strUserName = oUser.Name ;					 
    			IADsLargeInteger li_ad = (IADsLargeInteger)oUser.Properties["USNChanged"].Value ;
    			long l_uChanged = GetLongFromLargeInteger( li_ad );
    			System.Console.WriteLine( l_uChanged.ToString()+"  " + strUserName );
    			Console.ReadLine();
    		}
    
    		static long GetLongFromLargeInteger(  IADsLargeInteger  Li )
    		{
    			long retval = Li.HighPart;
    			retval <<=32;
    			retval |=(uint)Li.LowPart;
    			return retval;
    		}
    	}
    }
    
  9. ????? ?? ????? ???? TODO ?? ????? ???????? ???????? ???????. ????? ????? ???????? ???????? ?????? ?????? ??.
  10. ???? F5 ????? ? ?????? ???????.

?????

?????? ??? ??????? ?????? ??? ???? ????????? ?? "Active Directory" ?? ?????? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn2.microsoft.com/en-us/library/ms677974.aspx

?????? ??? ??????? ?????? ??? ???? ????????? ?? "Active Directory" ???? ??????? "???? ?????????" ?? ??? "??????? Active Directory" ?? Platform SDK.

???????

???? ???????: 326091 - ????? ??? ??????: 06/????? ??????/1428 - ??????: 2.5
????? ???
  • Microsoft Visual C# 2005 Express Edition
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
????? ??????: 
kbmt kbhowto KB326091 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????326091

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com