Powershell配置SharePoint环境(续)

Powershell配置SharePoint环境

1. 配置incoming email:

$loadasm =[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$Farm =[Microsoft.SharePoint.Administration.SPFarm]::Local

$IncomingMailService = [Microsoft.SharePoint.Administration.SPServiceCollection].GetMethod("GetValue",[String]).MakeGenericMethod([Microsoft.SharePoint.Administration.SPIncomingEmailService]).Invoke($Farm.Services,"")

$IncomingMailService.Enabled=$true

$IncomingMailService.UseAutomaticSettings=$true

$IncomingMailService.ServerDisplayAddress=“lastestSP10.DC-Chris1.com”

$IncomingMailService.ServerAddress=“lastestSP10.DC-Chris1.com”

$IncomingMailService.Update()

$Acl = (Get-Item"C:\Inetpub\mailroot\drop").GetAccessControl("Access")

$Ar = New-Object system.security.accesscontrol.filesystemaccessrule("WSS_ADMIN_WPG","FullControl","ContainerInherit,ObjectInherit","None","Allow")

$Acl.AddAccessRule($Ar)

$Ar2 = New-Object system.security.accesscontrol.filesystemaccessrule("WSS_WPG","Read","ContainerInherit,ObjectInherit","None","Allow")

$Acl.AddAccessRule($Ar2)

Set-Acl -aclobject $Acl"C:\Inetpub\mailroot\drop"

2. 配置health 规则:

$spWeb= Get-SPWeb -Identity http://siteurl

$spList =$spWeb.Lists["Health Analyzer Rule Definitions"]

$spListItem = $spList.GetItemById(48)

$spListItem["Schedule"]= “Weekly”

$spListItem.Update()

3. 配置User Profile Synchronization setting:

$userProAssembly= [Reflection.Assembly]::LoadFile("C:\Program Files\Common Files\MicrosoftShared\Web Server Extensions\14\ISAPI

\Microsoft.Office.Server.UserProfiles.dll")

$upa =Get-SPServiceApplication -Name "User Profile Service Application"

if($userProAssembly)

{

$bindingFlags = [Reflection.BindingFlags]"Static,GetProperty,NonPublic"

$userProType =$userProAssembly.GetType("Microsoft.Office.Server.Administration.UserProfileApplication")

$bindingFlags = "NonPublic","Instance"

$IsUpscaleILMUsed = $userProType.GetProperty("IsUpscaleILMUsed",$bindingFlags)

if($IsUpscaleILMUsed)

{

$IsUpscaleILMUsed.SetValue($upa,$true,$null)

}

$upa.Update()

}

$userProAssembly= [Reflection.Assembly]::LoadFile("C:\Program Files\Common Files\MicrosoftShared\Web Server Extensions\14\ISAPI

\Microsoft.Office.Server.UserProfiles.dll")

$upa =Get-SPServiceApplication -Name "User Profile Service Application"

if($userProAssembly)

{

$bindingFlags = [Reflection.BindingFlags]"Static,GetProperty,NonPublic"

$userProType =$userProAssembly.GetType("Microsoft.Office.Server.Administration.UserProfileApplication")

$bindingFlags = "NonPublic","Instance"

$IsUpscaleILMUsed = $userProType.GetProperty("IsUpscaleILMUsed",$bindingFlags)

$IsUsersOnlyILMImport =$userProType.GetProperty("IsUsersOnlyILMImport",$bindingFlags)

$SkipBDImport =$userProType.GetProperty("SkipBDImport",$bindingFlags)

if($IsUpscaleILMUsed)

{

$IsUpscaleILMUsed.SetValue($upa,$false,$null)

$IsUsersOnlyILMImport.SetValue($upa,$false,$null)

$SkipBDImport.SetValue($upa,$true,$null)

}

$upa.Update()

}

4. 创建和配置User Profile Syn Connection:

$upa =Get-SPServiceApplication -Name "User Profile Service Application"

$syncAccountPassword= convertto-securestring "Password1" -asplaintext -force

Add-SPProfileSyncConnection-ProfileServiceApplication $upa -ConnectionForestName "contoso.com"   -ConnectionDomain"Contoso"    -ConnectionUserName "spups" -ConnectionPassword $syncAccountPassword  -ConnectionSynchronizationOU"OU=SharePoint
Users,DC=contoso,DC=com"

时间: 2024-10-05 18:31:47

Powershell配置SharePoint环境(续)的相关文章

Powershell配置SharePoint环境

Powershell配置SharePoint环境 1. 设置outgoing email: 1) Powershell: $loadasm =[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $SPGlobalAdmin = New-Object Microsoft.SharePoint.Administration.SPGlobalAdmin $SPGlobalAdmin.UpdateM

Powershell配置SharePoint环境(再续)

1. 给用户在User Profile Service Application中赋权: $accountName = "contoso\testuser" $claimType ="http://schemas.microsoft.com/sharepoint/2009/08/claims/userlogonname" $claimValue = $accountName $claim = New-Object Microsoft.SharePoint.Admini

SharePoint 2016 配置工作流环境

前言 SharePoint 2016 默认创建工作流的时候,工作流平台只包含2010版本,如果想要使用状态机工作流,需要单独安装workflow manager 1.0才可以,下面,我们为大家介绍一下如何为环境安装workflow manager 1.0. SharePoint Designer 2013创建SharePoint 2016可重用工作流截图,只包含SharePoint 2010工作流版本. 工作流环境的安装主要包括两种,一种是使用Microsoft Web Platform Ins

SharePoint 2013 配置开发环境,需安装VS2012插件

SharePoint 2013已经安装好了,接下来就是配置开发环境,安装VS2012,但是装好以后,发现没有SharePoint 2013开发的支持,如下图: VS2012对SharePoint 2013支持,需要装VS插件. 先要安装Microsoft Web PlatForm Install 4.0的东东,然后这里面,可以添加如下图所选的组件.当然,这个需要联网在线安装的. 下载地址:http://www.microsoft.com/web/downloads/platform.aspx 安

sharepoint环境安装

SharePoint 2013 测试环境安装配置指南 软件版本 Windows Server 2012 标准版 SQL Server 2012 标准版 SharePoint Server 2013 企业版 Office Web Apps 2013 备注:安装之前,需要各个服务器的IP地址,机器名称设置好,并且已经加入到域中. 一 安装AD域控制器 1. 添加AD服务 a) 打开服务器管理器,选择[添加角色和功能] b) 在[开始之前]页面直接点击[下一步] c) 选择[基于角色或基于功能的安装]

安装和配置SharePoint 2013 Workflow

SharePoint 2013中的工作流概述 安装并配置工作流管理器 配置工作流管理器 与 SharePoint Server 2013 一起使用 测试是否正确安装和配置SharePoint Workflow 2013 小结 SharePoint 2013中的工作流概述 在SharePoint 2013中,Workflow(建立在Windows Workflow Foundation 4.5)和WCF承载在Workflow Manager中,即Workflow Manager提供了工作流定义的管

安装和配置SharePoint 2013 with SP1 Workflow

安装和配置SharePoint 2013 with SP1 Workflow SharePoint 2013 with SP1中的工作流概述 在SharePoint 2013 with SP1中,Workflow(建立在Windows Workflow Foundation 4.5)和WCF承载在Workflow Manager中,即Workflow Manager提供了工作流定义的管理,还承载了工作流实例的执行过程,是新的工作流引擎.为了侦听工作流的SharePoint事件(如itemCrea

通过PowerShell创建SharePoint Site Collection。

通过PowerShell创建SharePoint Site Collection,代码如下: Add-PSSnapin microsoft.sharepoint.powershell function CreateTeamSite() { $webApps = Get-SPWebApplication $webAppsUrl = $webApps.Url if($webApps.count -eq 1) { Write-Host "You have only one web applicatio

通过 powershell 配置 IIS

1. 设置iis pool: cls Import-Module WebAdministration Get-ChildItem IIS:\apppools | ForEach-Object{         $name = $_.name         Write-Host $_.name         $pool = Get-Item IIS:\AppPools\$name         $pool.recycling.periodicRestart.time = [TimeSpan]