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
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
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
# | |
# 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
<# | |
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
<# | |
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
#Parameters | |
$SCARMTemplate = 'https://raw.githubusercontent.com/Sitecore/Sitecore-Azure-Quickstart-Templates/master/Sitecore%209.0.0/XP/azuredeploy.json' | |
$Deploymentid = "scninecloud" #this will be the name of resoure group | |
$LicenseFile = "D:\projects\sitecore\license.xml" | |
$CertificateFile = 'D:\projects\sitecore\1A5A5EEF9F9237471DAF3A464457BC9A18D5EAC3.pfx' | |
$SubscriptionId = "cf764d1e-ba89-405d-9712-4b69a34bb353" | |
$Location = "eastus" | |
$ParamFile = "D:\Projects\Sitecore\sc9Cloud\Sitecore-Azure-Quickstart-Templates-2.0\Sitecore 9.0.0\XP\azuredeploy.parameters.json" | |
$Parameters = @{ | |
"authCertificateBlob" = [system.convert]:: ToBase64String([system.IO.File]::ReadAllBytes($certificatefile)); |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"deploymentId": { | |
"value": "" | |
}, | |
"location": { | |
"value": "eastus" | |
}, |
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
# https://stackoverflow.com/a/2292546/5532726 - Learn about .cer, .pvk and .pfx | |
$thumbprint = (New-SelfSignedCertificate ` | |
-Subject "CN=$env:COMPUTERNAME @ Sitecore, Inc." ` | |
-Type SSLServerAuthentication ` | |
-FriendlyName "$env:USERNAME Certificate").Thumbprint | |
#you can select the path for your pfx export as per your requirements | |
$certificateFilePath = "C:\Sitecore9\install\$thumbprint.pfx" | |
Export-PfxCertificate ` | |
-cert cert:\LocalMachine\MY\$thumbprint ` | |
-FilePath "$certificateFilePath" ` |
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
Set-Location "SQLSERVER:\SQL\Computer\Instance\Databases" | |
SQLSERVER:\SQL\Computer\Instance\Databases> ForEach($database in (Get-ChildItem)) { | |
$dbName = $database.Name | |
Backup-SqlDatabase -Database $dbName -BackupFile "\\mainserver\databasebackup\$dbName.bak" | |
} |