zoukankan      html  css  js  c++  java
  • 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 <domainaccount>)
    -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 SPAppPoolAccount -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 SPSiteAdmin
    -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
  • 相关阅读:
    EF性能优化-有人说EF性能低,我想说:EF确实不如ADO.NET
    MiniProfiler工具介绍(监控EF生成的SQL语句)--EF,迷你监控器,哈哈哈
    C# 数据库并发的解决方案(通用版、EF版)
    锁、C#中Monitor和Lock以及区别
    LINQ 如何动态创建 Where 子查询
    C# Npoi 实现Excel与数据库相互导入
    MVC ActionResult派生类关系图
    如何构造树状 JSON 数据 JSON-Tree
    如何构造分层次的 Json 数据
    如何使用 GroupBy 计数-Count()
  • 原文地址:https://www.cnblogs.com/justinliu/p/5961730.html
Copyright © 2011-2022 走看看