CÁC câu LỆNH cơ bản QUẢN lý các đối TƯỢNG TRONG ACTIVE DIRECTORY

6 859 3
CÁC câu LỆNH cơ bản QUẢN lý các đối TƯỢNG TRONG ACTIVE DIRECTORY

Đang tải... (xem toàn văn)

Thông tin tài liệu

CÁC CÂU LỆNH CƠ BẢN QUẢN LÝ CÁC ĐỐI TƯỢNG TRONG ACTIVE DIRECTORY DSADD (Thêm đối tượng) DSADD USER – Cú pháp: dsadd user [-fn ] [-mi ] [-ln ] [-display ] [-pwd { | *}] [-memberof ] [-office ] [-tel ] [-email ] [-hometel ] [-mobile ] [-fax ] [-webpg ] [-title ] [-dept ] [-company ] [-mgr ] [-mustchpwd {yes | no}] [canchpwd {yes | no}] [-reversiblepwd {yes | no}] [-pwdneverexpires {yes | no}] [-acctexpires ] [-disabled {yes | no}] Ví dụ: Tạo tài khoản người dùng có tên MikeDan thuộc container mặc định Users, thuộc miền northwindtraders.com enabled: dsadd user cn=MikeDan,cn=users,dc=northwindtraders,dc=com -disabled no Tạo tài khoản người dùng có tên John Smith, password C^h3Bdo9#, thuộc OU SouthEmployees, thuộc miền northwindtraders.com, buộc phải thay đổi password đăng nhập lần đầu enabled: dsadd user “cn=John Smith,ou=SouthEmployees,dc=northwindtraders,dc=com” -disabled no –pwd C^h3Bdo9# -mustchpwd yes Tạo tài khoản trên, thành viên nhóm Janitors, thuộc OU SouthEmployees, thuộc miền northwindtraders.com thiết lập tài khoản không hết hạn: dsadd user “cn=John Smith,ou=SouthEmployees,dc=northwindtraders,dc=com” -disabled no –pwd C^h3Bdo9# -mustchpwd yes -memberof cn=janitors,ou=SouthEmployees,dc=northwindtraders,dc=com -acctexpires never DSADD GROUP - Cú pháp: dsadd group [-secgrp {yes | no}] [-scope {l | g | u}] [-memberof ] [members ] Ví dụ: Tạo tài khoản nhóm có tên Sales thuộc container mặc định Users, thuộc miền northwindtraders.com: dsadd group cn=sales,cn=users,dc=northwindtraders,dc=com Tạo universal group “accounting” thuộc OU Departments, thuộc miền northwindtraders.com: dsadd group cn=accounting,ou=departments,dc=northwindtraders,dc=com –scope u DSADD OU - Cú pháp: dsadd ou [-desc ] Ví dụ: Tạo OU Test thuộc miền northwindtraders.com: dsadd ou ou=test,dc=northwindtraders,dc=com DSMOD (Thay đổi thuộc tính đối tượng) DSMOD USER - Cú pháp: dsmod user > [-fn ] [-mi ] [-ln ] [-display ] [-pwd { | *}] [-memberof ] [-office ] [-tel ] [-email ] [-hometel ] [-mobile ] [-fax ] [-webpg ] [-title ] [-dept ] [-company ] [-mgr ] [-mustchpwd {yes | no}] [canchpwd {yes | no}] [-reversiblepwd {yes | no}] [-pwdneverexpires {yes | no}] [-acctexpires ] [-disabled {yes | no}] Ví dụ: Reset password cho user Don Funk buộc user phải thay đổi password lần đăng nhập tiếp theo: dsmod user "CN=Don Funk,CN=Users,DC=Contoso,DC=Com" -pwd A1b2C3d4 -mustchpwd yes Reset password cho nhiều user lúc buộc user phải thay đổi password lần đăng nhập tiếp theo: dsmod user "CN=Don Funk,CN=Users,DC=Contoso,DC=Com" "CN=Denise Smith,CN=Users,DC=Contoso,DC=Com" -pwd A1b2C3d4 -mustchpwd yes Disable nhiều tài khoản người dùng lúc: dsmod user "CN=Don Funk,CN=Users,DC=Contoso,DC=Com" "CN=Denise Smith,CN=Users,DC=Contoso,DC=Com" -disabled yes DSMOD GROUP - Cú pháp: dsmod group [-secgrp {yes | no}] [-scope {l | g | u}] [{-addmbr | -rmmbr | -chmbr} Ví dụ: Thêm tất thành viên thuộc nhóm US Info vào nhóm Canada Info: dsget group "CN=US INFO,OU=Distribution Lists,DC=contoso,DC=com" -members | dsmod group "CN=CANADA INFO,OU=Distribution Lists,DC= contoso,DC=com" -addmbr Chuyển đổi từ kiểu security sang nonsecurity cho nhiều nhóm: dsmod group "CN=US Info,OU=Distribution Lists,DC=Contoso,DC=Com" "CN=Canada Info,OU=Distribution Lists,DC=Contoso,DC=Com" "CN=Mexico Info,OU=Distribution Lists,DC=Contoso,DC=Com" -secgrp no Thêm người dùng vào nhóm "CN=US Info,OU=Distribution Lists,DC=Contoso,DC=Com": dsmod group "CN=US Info,OU=Distribution Lists,DC=Contoso,DC=Com" -addmbr "CN=Mike Danseglio,CN=Users,DC=Contoso,DC=Com" "CN=Legal,OU=Distribution Lists,DC=Contoso,DC=Com" "CN=Denise Smith,CN=Users,DC=Contoso,DC=Com" Thêm tất users từ OU Marketing vào OU Marketing Staff (đã có sẵn): dsquery user OU=Marketing,DC=Contoso,DC=Com | dsmod group "CN=Marketing Staff,OU=Marketing,DC=Contoso,DC=Com" -addmbr Gỡ bỏ users OU Marketing khỏi group Marketing Staff: dsquery user OU=Marketing,DC=Contoso,DC=Com | dsmod group "CN=Marketing Staff,OU=Marketing,DC=Contoso,DC=Com" -rmmbr Gỡ bỏ thành viên khỏi nhóm "CN=US Info,OU=Distribution Lists,DC=Contoso,DC=Com": dsmod group "CN=US Info,OU=Distribution Lists,DC=Contoso,DC=Com" -rmmbr "CN=Mike Danseglio,CN=Users,DC=Contoso,DC=Com" "CN=Legal,OU=Distribution Lists,DC=Contoso,DC=Com" DSMOD OU - Cú pháp: dsmod ou [-desc ] Ví dụ: Thay đổi mô tả (description) cho nhiều OU lúc: dsmod ou "OU=Domain Controllers,DC=Contoso,DC=Com" "OU=Resources,DC=Contoso,DC=Com" "OU=Troubleshooting,DC=Contoso,DC=Com" -desc "This is a test OU" DSQUERRY (Tìm kiếm đối tượng) DSQUERRY USER - Cú pháp: dsquery user [{ | forestroot | domainroot}] [-o {dn | rdn | upn | samid}] [-scope {subtree | onelevel | base}] [-name ] [-desc ] [-upn ] [-inactive ] [-disabled] Ví dụ: Hiển thị UPN (User Principal Name) tất users OU bạn định mà có tên user bắt đầu “Jon” tài khoản bị disabled: dsquery user OU=Test,DC=Contoso,DC=Com -o upn -name jon* -disabled Hiển thị tên tất users domain mà tên user kết thúc “Smith” user không làm việc từ tuần trở lên: dsquery user domainroot -name *smith -inactive Hiển thị UPN tất user “OU=Sales,DC=Contoso,DC=Com”: dsquery user OU=Sales,DC=Contoso,DC=Com -o upn DSQUERRY GROUP - Cú pháp: dsquery group [{ | forestroot | domainroot}] [-o {dn | rdn | samid}] [-scope {subtree | onelevel | base}] [-name ] [-desc ] Ví dụ: Tìm tất nhóm nằm domain mà có tên bắt đầu “ms” có phần mô tả bắt đầu “admin”: dsquery group domainroot -name ms* -desc admin* Tìm tất nhóm domain DC=Contoso,DC=Com: dsquery group DC=Contoso,DC=Com DSQUERRY OU - Cú pháp: dsquery ou [{ | forestroot | domainroot}] [-o {dn | rdn}][-scope {subtree | onelevel | base}][-name ... (Xóa đối tượng) Cú pháp: dsrm [-subtree [-exclude]] [-noprompt] [{-s | -d }] [-u ] [-p { | *}] [-c] [-q] Ví dụ: Xóa OU Marketing tất đối tượng. .. "OU=Resources,DC=Contoso,DC=Com" "OU=Troubleshooting,DC=Contoso,DC=Com" -desc "This is a test OU" DSQUERRY (Tìm kiếm đối tượng) DSQUERRY USER - Cú pháp: dsquery user [{ | forestroot | domainroot}] [-o {dn... -desc sales* Tìm tất OU domain DC=Contoso,DC=Com: dsquery ou DC=Contoso,DC=Com DSMOVE (Di chuyển đối tượng) Cú pháp: dsmove [-newname ] [-newparent ] [{-s |

Ngày đăng: 04/12/2015, 02:40

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan