SharePoint的安装和配置-PowerShell

1. 引入SPModule组件

Import-Module SPModule.misc
Import-Module SPModule.setup

需要将执行策略修改为不限制

2. 无人值守安装SharePoint

Install-SharePoint –setupexepath D:\setup.exe –configxmlpath
c:\config.xml

配置文件示例

<Configuration>
    <Package Id="sts">
        <Setting Id="LAUNCHEDFROMSETUPSTS" Value="Yes"/>
    </Package>
    <Package Id="spswfe">
        <Setting Id="SETUPCALLED" Value="1"/>
    </Package>
    <Logging Type="verbose" Path="%temp%"
Template="SharePoint Server Setup(*).log"/>
    <!--<PIDKEY Value="Enter Product Key Here" />-->
    <Setting Id="SERVERROLE" Value="APPLICATION"/>
    <Setting Id="USINGUIINSTALLMODE" Value="1"/>
    <Setting Id="SETUPTYPE" Value="CLEAN_INSTALL"/>
    <Setting Id="SETUP_REBOOT" Value="Never"/>
</Configuration>

反注释PIDKEY,在Value属性处输入序列号

但是出于安全考虑,你可能不想把序列号存储在配置文件中,则可添加命令参数PIDKey

Install-SharePoint –setupexepath D:\setup.exe –configxmlpath
c:\config.xml -PIDKey "ABDCE-FGHIJ-KLMNO-PQRST-UVWXY"

3. 配置一个新的SharePoint场

New-SharePointFarm -databaseserver <server name>
-databaseaccessaccount (Get-Credential <domain\account>)
-farmname <name of new farm>
-passphrase (ConvertTo-SecureString -asplaintext -force -string "Enter a farm pass phrase here")

4. 添加一个服务器到SharePoint场

Join-SharePointFarm –databaseserver <database server name>
-configurationdatabasename <config database>
-passphrase (ConvertTo-SecureString -asplaintext -force -string
"<farm pass phrase>")

5. 创建一个Web应用程序

New-SPWebApplication –applicationpool <name of new application pool>
-name <name of new web app>
-applicationpoolaccount <service account to be used for the
application pool> -port <desired port number>

例如

New-SPWebApplication –applicationpool SharePoint-80
-name SharePoint-80 -applicationpoolaccount SP\AppPoolAccount -port 80

6. 创建一个网站集

New-SPSite –url <full url of new site collection>
-name <name of new site collection>
-owneralias <site collection administrator>
-template <site collection template to use>

例如

New-SPSite –url http://sp2010/ -name Home -owneralias SP\SiteAdmin
-template STS#0

网站模板名称可以通过Get-SPWebTemplates命令获得

7. 创建一个网站

New-SPWeb –url <full url of new site> -name <name of new site>
-template <site template to use> 
-AddToTopNav(Optional)
-UniquePermissions(Optional)
-UseParentTopNav(Optional)

例如

New-SPWeb –url http://sp2010/PSSubSite -name "PS Sub Site"
-template STS#0 –AddToTopNav –UniquePermissions -UseParentTopNav
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值