My status

My backup memory

Thứ Tư, 20 tháng 4, 2011

Active Directory Administration with Windows PowerShell

+ Để sử dụng được PowerShell phải cài đặt module AD module for Windows PowerShell. Đối vowsi Win7, phải download RSAT (Remote Server Administration Tools) từ http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d rồi cài đặt (kích thước khoảng 240Mb).
+ Tài liệu tham khảo:
Active Directory Administration with Windows PowerShell
http://technet.microsoft.com/en-us/library/dd378937%28WS.10%29.aspx

Active Directory Cmdlets in Windows PowerShell
http://technet.microsoft.com/en-us/library/ee617195.aspx

Danh sách cmdlet trong tài liệu của Microsoft có tính chất liệt kê. Tài liệu này (Introducing the Active Directory Module for Windows PowerShell) sắp xếp và phân loại theo chức năng dễ hiểu hơn
+ Retrieve Information
+ Create Objects
+ Delete Objects
+ Set Properties
+ Add Objects
+ Disable Objects and Features
+ Enable Objects and Features
+ Move Objects
+ Rename Objects
+ Reset Objects
+ Restore Objects
+ Search
+ Uninstall
+ Unlock
+ Clear
+ Install

Hướng dẫn quản trị AD Group--> How-To Administer Active Directory Domain Services Groups Using Windows PowerShell
Hướng dẫn quản trị User--> How-To Administer Active Directory Domain Services User Accounts Using Windows PowerShellHow-To Search Active Directory Domain Services Password and Account Settings Using Windows PowerShell
Hướng dẫn tạo script để tự động tạo user từ csv file
http://www.myexchangeworld.com/2010/02/powershell-provisioning-users/

Ví dụ về một số lệnh hay sử dụng:
+ Để di chuyển tới thư mục làm việc
cd "DC=hq,DC=fabrikam,DC=com"
+ Tao OU mới với mô tả
New-ADOrganizationalUnit -Name "" -Description "" -ManagedBy ""
+ Thêm thuộc tính
Set-ADOrganizationalUnit -Identity "OU=vat tu,DC=cs1,DC=benhvienk,DC=vn" -Country "VN" -StreetAddress "" -City "" -State ""

+ Tạo User mới
New-ADUser -SamAccountName admin2 -Name "admin2" -AccountPassword (ConvertTo-SecureString -AsPlainText "123456" -Force) -Enabled $true -ChangePasswordAtLogon $true -Path 'CN=users,DC=hq,DC=fabrikam,DC=com'

Không có nhận xét nào:

Đăng nhận xét