by1455的自留地

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

PS1文件

 

Write-Host

if($args) {
  $SiteName = $args[0]
  $SiteUrl = "
http://win2k8r2/sites/" + $SiteName
  Write-Host "Begin creating SPS2010 site at" $SiteUrl
  Write-Host
  $NewSite = New-SPSite -URL $SiteUrl -OwnerAlias Administrator -Template STS#1 -Name $SiteName
  $RootWeb = $NewSite.RootWeb
  $RootWeb.Title = "My SPS2010 Site: " + $SiteName
  $RootWeb.Update()
  Write-Host "New Contoso site successfully created"
  Write-Host "-------------------------------------"
  Write-Host "Title:" $RootWeb.Title -foregroundcolor Yellow
  Write-Host "URL:" $RootWeb.Url -foregroundcolor Yellow
  Write-Host "ID:" $RootWeb.Id.ToString() -foregroundcolor Yellow
}
Else {
  Write-Host "ERROR: You must supply Name as parameter when calling CreateSite.ps1"
}

Write-Host

 

 

posted on 2010-01-03 21:05  by1455  阅读(191)  评论(0编辑  收藏  举报