windows2012 active directory설치및연동

24
Windows2012 AD Install & link With JAVA & using JNDI [email protected] Yun Suk Jin

Upload: sukjin-yun

Post on 04-Jul-2015

1.364 views

Category:

Technology


1 download

DESCRIPTION

windows2012에서 AD Service를 Install하고 Java를 이용해서 계정을 생성해보자. how to install AD Service on windows2012 and how to manipulate ad Account using Java Jndi

TRANSCRIPT

Page 1: Windows2012 active directory설치및연동

Windows2012

AD Install & link

With JAVA & using JNDI

[email protected]

Yun Suk Jin

Page 2: Windows2012 active directory설치및연동

2012에서의 달라진 점

우리의 Hope

dcpromo 명령어가

사라졌습니다.

하던 대로 하면 안돼?

응 안돼. ^^;

Page 3: Windows2012 active directory설치및연동

역할 및 기능추가

Page 4: Windows2012 active directory설치및연동

AD도메인 서비스

Page 5: Windows2012 active directory설치및연동

그룹정책 관리 선택

그룹 정책 관리가 선택되

어 있는지 확인

Page 6: Windows2012 active directory설치및연동

Ad 서비스 설치

Page 7: Windows2012 active directory설치및연동

DC로 구성

Page 8: Windows2012 active directory설치및연동

DNS 에러

에러가 복잡해보이지만

DNS 서버를 구성하지 않아서 발

생하는 오류이다.

AD 서버는 DNS 정보를 기반으로

동작한다. 따라서 이 에러가 싫다

면 DNS 서비스를 Windows

Server에 먼저 설치하면 된다.

그렇지만 지금은 test 환경이므로

생략

Page 9: Windows2012 active directory설치및연동

netbios등록

기다리면 알아서 서버의 Netbios

name을 읽어온다.

Page 10: Windows2012 active directory설치및연동

AD 스키마 저장공간지정

Page 11: Windows2012 active directory설치및연동

AD DomainController로 설치

Page 12: Windows2012 active directory설치및연동

AD DS 구성도구 명령 확인

Page 13: Windows2012 active directory설치및연동

Using JAVA

Page 14: Windows2012 active directory설치및연동

Properties 파일 정의

• 연동할 AD 2012 server의 정보를

Properties 파일에 담아보자.

win2012.properties

• adminName = jins\\administrator

• adminPassword =Qwer1234

• ldapURL = ldap://192.168.3.88:389

• newPassword = abcd1234

Basic Auth 사용 시 389포트

를 사용한다.

Page 15: Windows2012 active directory설치및연동

Properties 파일을 읽자

• String propUrl = "C:\\99.web_eclipse\\00.java_work\\01.nad\\jndiLdap\\src\\oucrud\\win2012.properties";

• Properties prop = new Properties();

• prop.load(new FileInputStream(propUrl));

• String adminName = prop.getProperty("adminName");

• String adminPassword = prop.getProperty("adminPassword");

• String ldapURL = prop.getProperty("ldapURL");

Page 16: Windows2012 active directory설치및연동

JNDI Context 사용

• 우선 Context에 환경변수를 등록하자.

• env.put(Context.INITIAL_CONTEXT_FACTORY,

• "com.sun.jndi.ldap.LdapCtxFactory");

• env.put(Context.SECURITY_AUTHENTICATION, "simple");

• env.put(Context.SECURITY_PRINCIPAL, adminName);

• env.put(Context.SECURITY_CREDENTIALS, adminPassword);

• env.put(Context.PROVIDER_URL, ldapURL);

Page 17: Windows2012 active directory설치및연동

Context 객체 생성

Context Instance에 환경변수를 담고

객체를 생성하자.

Page 18: Windows2012 active directory설치및연동

스펙에 맞는 정보 입력

• 모든 연동의 기본은 target System 분석 및

target System 필수 파라메터를 매칭해서

입력해주는 것이다.

Attributes 클래스를 이용해서 이 작업을 진행

하자.

Page 19: Windows2012 active directory설치및연동

Using Attributes

ObjectCategory 전까지가

AD에서 사용자를 생성할 때

요구하는 사용자에 대한 기본

정보이다.

그렇지만 AD는 계층구조이기

때문에 ObjectCategory를 통해

서 객체의 위치를 표현한다.

Page 20: Windows2012 active directory설치및연동

AD의 계층 표현

DN값과ObjectClass값을조합하여 java의Context 객체는 개발자가 원하는 위치에 사용자를 생성할 수 있게된다.

Page 21: Windows2012 active directory설치및연동

패스워드에 대한 속성

• 계정 생성시에 UAC를이용하여 계정 생성 후패스워드 변경, 패스워드만료일 같은정책을 설정할 수 있다.

Page 22: Windows2012 active directory설치및연동

계정 생성해줘~

Attribute 들을 차곡 차곡 쌓은 후에

CreateSubContext 메소드를 실행

하면 계정이 생성된다.

Page 23: Windows2012 active directory설치및연동

결과 확인

Page 24: Windows2012 active directory설치및연동

Done Thk

[email protected]

Yun Suk Jin