This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Author(s): Bruce Lee, Grant Killian, Kelly Rusk, Jimmy Rudley | |
Created Date: August 4, 2016 | |
Modified Date: May 3, 2017 | |
This is the Rackspace Managed Services for Sitecore (https://www.rackspace.com/digital/sitecore) script for security hardening a Sitecore environment | |
If the Execution Policy does not allow execution, you may need to run the following interactively to allow a scoped session bypass. | |
This is secure as it requires interaction on server and cannot be executed from a script: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Powershell script for adding/removing/showing entries to the hosts file. | |
# | |
# Known limitations: | |
# - does not handle entries with comments afterwards ("<ip> <host> # comment") | |
# | |
$file = "C:\Windows\System32\drivers\etc\hosts" | |
function add-host([string]$filename, [string]$ip, [string]$hostname) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function xEnsurePresent-WindowsFeature([string] $FeatureName) | |
{ | |
$gwf = Get-WindowsFeature -Name $FeatureName | |
if($gwf.InstallState -eq 'Installed') | |
{ | |
Write-Host "$FeatureName already Installed" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Text.RegularExpressions; | |
using System.Web.Mvc; | |
using Microsoft.Extensions.DependencyInjection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# MongoDB (as a windows service) | |
# | |
$mongoDbPath = "$env:SystemDrive\MongoDB" | |
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg" | |
$url = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-3.2.7.zip" | |
$zipFile = "$mongoDbPath\mongo.zip" | |
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-3.2.7" | |
if ((Test-Path -path $mongoDbPath) -eq $false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download locaton: https://download.microsoft.com/download/B/F/2/BF2EDBB8-004D-47F3-AA2B-FEA897591599/SQLServer2016-SSEI-Expr.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE LOGIN NewAdminName WITH PASSWORD = 'ABCD' | |
GO | |
--Here is how you create a User with db_owner privileges using the Login you just declared: | |
Use YourDatabase; | |
GO | |
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'NewAdminName') | |
BEGIN | |
CREATE USER [NewAdminName] FOR LOGIN [NewAdminName] | |
EXEC sp_addrolemember N'db_owner', N'NewAdminName' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Chocolatey if it's not already installed | |
if (-Not (Get-Command -Name choco -ErrorAction SilentlyContinue)) { | |
Set-ExecutionPolicy RemoteSigned | |
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
refreshenv | |
} | |
# Core (All Machines) | |
choco install 7zip.install -y | |
choco install googlechrome -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
$solrVersion = "6.6.2", | |
$installFolder = "c:\solr", | |
$solrPort = "8983", | |
$solrHost = "solr", | |
$solrSSL = $true, | |
$nssmVersion = "2.24", | |
$JREVersion = "1.8.0_151" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the Sitecore MyGet repository to PowerShell | |
#Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2 | |
# Install the Sitecore Install Framwork module | |
#Install-Module SitecoreInstallFramework | |
# Install the Sitecore Fundamentals module (provides additional functionality for local installations like creating self-signed certificates) | |
#Install-Module SitecoreFundamentals | |
# Import the modules into your current PowerShell context (if necessary) |