茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1673959 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_00061.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

微軟帝國 : [轉貼]用 New-ADOrganizationalUnit 批量建立數個 OU 我該如何下指令?

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15771
[轉貼]AD Group Batch Insert 冷日範本
經過上面的功課,冷日後來的作法是:
1.先做一個 CSV
範本:
OU,OU_FullName,OU_Desc,Group,Group_Desc
AOX,"OU=AOX,OU=theComOU,DC=comName,DC=org,DC=tw",總經理,g0OX,總經理群組
AXO,"OU=AXO,OU=theComOU,DC=comName,DC=org,DC=tw",留職停薪,gAXO,留職停薪群組
BOX,"OU=BOX,OU=theComOU,DC=comName,DC=org,DC=tw",秘書室,gBOX,秘書室群組
BXO,"OU=BXO,OU=theComOU,DC=comName,DC=org,DC=tw",法務部,gBXO,法務部群組
GOX,"OU=GOX,OU=theComOU,DC=comName,DC=org,DC=tw",台南客服,gGOX,台南客服群組
GXO,"OU=GXO,OU=theComOU,DC=comName,DC=org,DC=tw",高雄客服,gGXO,高雄客服群組

2.寫一個 PowerShell
範本:
# Imports groups and description list from CSV file
$GetOUWithDesc = Import-CSV "OU_Group_Desc_Import_Mapping.csv"

foreach ($item in $GetOUWithDesc) {
# Map variables from CSV
	$group = $item.'Group'
	$description = $item.'Group_Desc'
	$oupath = $item.'OU_FullName'
# Creates Active Directory Group
	New-ADGroup –name $group –groupscope Global -Description $description –path $oupath
}

3.把檔案都上傳道 2012 Server 上
4.運行該 PowerShell
5.進 AD 檢查,收工!
前一個主題 | 下一個主題 | | | |

討論串




Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|