'Active Directory'에 해당되는 글 7건
- 2008/07/23 사용자의 RTC 정보를 보는 코드
- 2008/03/27 Exchange를 설치하지 않고 AD 스키마 확장
- 2007/09/16 Active Directory User/Group Encapsulation Classes
- 2007/09/12 Moss Authentication Active directory
- 2007/09/06 Active directory how to
- 2007/09/06 Active Directory ㅠ_ㅠ
- 2007/09/05 Active directory 제어
출처 : Read RTC properties from active directory users
http://www.haverhoek.nl/index.php?/archives/22-Read-RTC-properties-from-active-directory-users.html
이 스크립트는 AD의 사용자중에 RTC 활성화된 사용자의 RTC 정보를 읽을 수 있는 스크립트입니다.
This script reads all RTC properties from all RTC enabled users from Active Directory.
파일을 적당한 이름의 *.vbs 로 저장한 후 실행해 보시면 됩니다.
사용자가 많을 경우 Alert 창이 여러번 뜨기 때문에 출력방식을 바꾸거나 파일로 저장하도록 하는 방법도 좋을듯 하네요.
On Error Resume Next
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
' Search for users that are RTC enabled
objCommand.CommandText = "Select samAccountName,msRTCSIP-PrimaryUserAddress,msRTCSIP-FederationEnabled" & _
",msRTCSIP-ArchivingEnabled,msRTCSIP-InternetAccessEnabled,msRTCSIP-Line,msRTCSIP-LineServer" & _
",msRTCSIP-UserEnabled,msRTCSIP-UserExtension,msRTCSIP-UserPolicy,telephoneNumber,mail" & _
",msRTCSIP-OptionFlags,msRTCSIP-OriginatorSid,msRTCSIP-PrimaryHomeServer,msRTCSIP-TargetHomeServer " & _
"from 'LDAP://dc=domain,dc=local' " & _
"where objectClass='user' and msRTCSIP-UserEnabled=TRUE"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = 2
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
strAccountName = objRecordset.Fields("samAccountName").Value
wscript.echo "strAccountName = " & strAccountName
strURI = objRecordset.Fields("msRTCSIP-PrimaryUserAddress").Value
wscript.echo "strURI = " & strURI
bFederationEnabled = objRecordset.Fields("msRTCSIP-FederationEnabled").Value
wscript.echo "bFederationEnabled = " & CStr(bFederationEnabled)
strArchivingEnabled = objRecordset.Fields("msRTCSIP-ArchivingEnabled").Value
wscript.echo "strArchivingEnabled = " & strArchivingEnabled
bInternetAccessEnabled = objRecordset.Fields("msRTCSIP-InternetAccessEnabled").Value
WScript.Echo "bInternetAccessEnabled = " & CStr(bInternetAccessEnabled)
strLine = objRecordset.Fields("msRTCSIP-Line").Value
WScript.Echo "strLine = " & strLine
strLineServer = objRecordset.Fields("msRTCSIP-LineServer").Value
WScript.Echo "strLineServer = " & strLineServer
intOptionFlags = objRecordset.Fields("msRTCSIP-OptionFlags").Value
WScript.Echo "intOptionFlags = " & intOptionFlags
sidOriginatorSid = objRecordset.Fields("msRTCSIP-OriginatorSid").value
WScript.Echo "sidOriginatorSid = " & sidOriginatorSid
strPrimaryHomeServer = objRecordset.Fields("msRTCSIP-PrimaryHomeServer").value
WScript.Echo "strPrimaryHomeServer = " & strPrimaryHomeServer
strTargetHomeServer = objRecordset.Fields("msRTCSIP-TargetHomeServer").value
WScript.Echo "strTargetHomeServer = " & strTargetHomeServer
bUserEnabled = objRecordset.Fields("msRTCSIP-UserEnabled").value
WScript.Echo "bUserEnabled = " & CStr(bUserEnabled)
strUserExtension = objRecordset.Fields("msRTCSIP-UserExtension").value
WScript.Echo "strUserExtension = " & strUserExtension
binUserPolicy = objRecordset.Fields("msRTCSIP-UserPolicy").value
WScript.Echo "binUserPolicy = " & binUserPolicy
strTelephoneNumber = objRecordset.Fields("telephoneNumber").value
WScript.Echo "strTelephoneNumber = " & strTelephoneNumber
strMail = objRecordset.Fields("mail").value
WScript.Echo "strMail = " & strMail
WScript.Echo "================================================="
objRecordSet.MoveNext
Loop
objRecordSet.Close
Set objRecordSet = Nothing
Set objCommand = Nothing
objConnection.Close
Set objConnection = Nothing
'Microsoft > Lync/OCS' 카테고리의 다른 글
| OCS 자동로그인 구성 시 요청하는 순서 (1) | 2009/01/09 |
|---|---|
| OCS DVT Step by step (0) | 2009/01/06 |
| 사용자의 RTC 정보를 보는 코드 (0) | 2008/07/23 |
| OCS와 Exchange UM의 통합 ‘Enable-UMMailbox’ (0) | 2008/06/27 |
| OCS 토폴로지의 Enterprise Edge 구성 시 추가 작업 (0) | 2008/06/25 |
| OCS 사용자 환경의 AV 포트(Port) 허용범위(range) 지정 (0) | 2008/06/17 |
Active Directory에는 MS에서 제공하는 여러 정보를 저장할 수 있도록 속성들을 정의해 두었고, 이를 확장할 수 있도록 되어있다.
Exchange에서는 또 AD를 확장해 설치하고 그에 필요한 정보를 담고 있는데 Exchange 서버를 설치하지 않고 Exchange의 Active Directory 스키마 확장하는 방법이 가끔 필요할 때가 있다.
이럴 때에 다음과 같은 기술문서를 참고하도록 하자.
http://support.microsoft.com/?scid=327757
위 문서에는 다음과 같은 내용을 포함한다.
more..
'System > OS' 카테고리의 다른 글
| 특정 폴더 주기적인 자동 백업 (0) | 2008/07/01 |
|---|---|
| SMTP 서비스가 재시작 시 작동하지 않는 오류 (0) | 2008/05/06 |
| Exchange를 설치하지 않고 AD 스키마 확장 (0) | 2008/03/27 |
| Microsoft Windows Server 2008 (0) | 2007/11/14 |
| Windows XP 기본 압축폴더 사용 안하려면.. (0) | 2007/10/17 |
| SvcHost CPU점유율 100%문제 해결 Download (0) | 2007/04/29 |
AD를 사용하기 쉽도록 제공되는 Class 이다.
Download source and demo projects - 34.9 KB
'.NET' 카테고리의 다른 글
| MS 자격증 MCP 시험 One+One 2 Shot 서비스 안내 (0) | 2007/11/13 |
|---|---|
| Windows Scripting를 이용해 AD에 LDAP과 ADSI를 이용한 사용자 추가 (0) | 2007/11/09 |
| MS .NET FrameWork 공개 (0) | 2007/10/31 |
| Active Directory User/Group Encapsulation Classes (0) | 2007/09/16 |
| MOSS + AJAX + A tinkle of Imagination = Endless Web 2.0 Possibilities (0) | 2007/07/19 |
| COM+ 자동등록 배치파일 (2) | 2007/05/30 |
http://technet2.microsoft.com/Office/en-us/library/23b837d1-15d9-4621-aa0b-9ce3f1c7153e1033.mspx?mfr=true
Use Forms Authentication with SQL Server in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/library/ms998317.aspx
Active Directory Role provider
http://www.codeplex.com/adrp
'Microsoft > SPS/MOSS' 카테고리의 다른 글
| MOSS 데이터가 저장되는 테이블들 (0) | 2007/09/14 |
|---|---|
| CAML XML Editor (0) | 2007/09/13 |
| Moss Authentication Active directory (0) | 2007/09/12 |
| Active Directory를 이용한 Form Authentication의 접근 방향 (0) | 2007/09/11 |
| MOSS Form based authentication (0) | 2007/09/07 |
| Active directory how to (0) | 2007/09/06 |
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
DirectoryEntryobject 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
DirectoryEntryobject inChildrencollection 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
Childrencollection, 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.
UserFlagsMaxStoragePasswordAgePasswordExpiredLoginHoursFullNameDescriptionBadPasswordAttemptsLastLoginHomeDirectoryLoginScriptProfileHomeDirDriveParametersPrimaryGroupIDNameMinPasswordLengthMaxPasswordAgeMinPasswordAgePasswordHistoryLengthAutoUnlockIntervalLockoutObservationIntervalMaxBadPasswordsAllowedRasPermissionsobjectSid
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,
IAdsUserinterface providesSetPasswordmethod to set a user's password. This is whereInvokemethod ofDirectoryEntryclass comes handy. So we callInvoketo set the password value. TheInvokemethod 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 callingCommitChangesorSetInfomethod. 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
CommitChangesmethod on newly addedDirectoryEntryobject.
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
'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 |
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);
}
}
}
}
}
'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 |
MOSS.. 아 짜증.. Active directory를 코딩으로 제어해야한다.. 된장..
'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 |

Prev




