首页 > 其他 > 详细

SharePoint 2013 pre-config

时间:2014-03-13 04:17:21      阅读:416      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
#region 1. add winrm, application server and web server role
Add-WindowsFeature winrm-iis-ext, Application-Server,Web-Server -IncludeAllSubFeature
#endregion

#region 2. disable UAC
Function Test-RegistryValue 
{
    param(
        [Alias("RegistryPath")]
        [Parameter(Position = 0)]
        [String]$Path
        ,
        [Alias("KeyName")]
        [Parameter(Position = 1)]
        [String]$Name
    )

    process 
    {
        if (Test-Path $Path) 
        {
            $Key = Get-Item -LiteralPath $Path
            if ($Key.GetValue($Name, $null) -ne $null)
            {
                if ($PassThru)
                {
                    Get-ItemProperty $Path $Name
                }       
                else
                {
                    $true
                }
            }
            else
            {
                $false
            }
        }
        else
        {
            $false
        }
    }
}

Function Disable-UAC
{
    $EnableUACRegistryPath = "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System"
    $EnableUACRegistryKeyName = "EnableLUA"
    $UACKeyExists = Test-RegistryValue -RegistryPath $EnableUACRegistryPath -KeyName $EnableUACRegistryKeyName 
    if ($UACKeyExists)
    {
        Set-ItemProperty -Path $EnableUACRegistryPath -Name $EnableUACRegistryKeyName -Value 0
    }
    else
    {
        New-ItemProperty -Path $EnableUACRegistryPath -Name $EnableUACRegistryKeyName -Value 0 -PropertyType "DWord"
    }
}

Disable-UAC
#endregion

#region 3. Run enable psremoting
#Run winrm quickconfig defaults
echo Y | winrm quickconfig

#Run enable psremoting command with defaults
enable-psremoting -force

#Enabled Trusted Hosts for Universial Access
cd wsman:
cd localhost\client
Set-Item TrustedHosts * -force
restart-Service winrm
echo "Complete"

set-ExecutionPolicy RemoteSigned -Force

#endregion

Restart-Computer -Force -Confirm:$false
bubuko.com,布布扣

SharePoint 2013 pre-config,布布扣,bubuko.com

SharePoint 2013 pre-config

原文:http://www.cnblogs.com/fengwenit/p/3596677.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!