Skip to content

Instantly share code, notes, and snippets.

gwmi Win32_BIOS -ov a | out-null; gwmi Win32_OperatingSystem -ov b | select PSComputerName, @{n="ServicePackMajorVersion";e={$b.ServicePackMajorVersion}}, @{n="Version";E={$b.Version}}, @{N="BIOS Serial";E={$a.SerialNumber}}
{
"group": "Network Service",
"graph": "E:\\images",
"tlscacert": "C:\\ProgramData\\docker\\certs.d\\rootCA.cer",
"tlskey": "C:\\ProgramData\\docker\\certs.d\\privateKey.cer",
"hosts": [
"tcp://0.0.0.0:2376",
"npipe://"
],
"tlscert": "C:\\ProgramData\\docker\\certs.d\\serverCert.cer",
version: '3.2'
services:
webredirect:
image: webopscr.azurecr.io/webredirect:20170727_1258
environment:
- "SHELL=powershell.exe"
- "HostName={{.Node.ID}}"
- "SecretLocation=c:\\programdata\\docker\\secrets\\ProductionCredentials.json"
- "ServiceLabels={{.Service.Labels}}"
ports:
@artisticcheese
artisticcheese / local.xml
Last active August 10, 2017 17:29
local.testsettings
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="8912d4fb-1ed0-4d91-98cf-787f3ffb50aa" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment enabled="false" />
<Execution>
<TestTypeSpecific >
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207" simulateThinkTimes="true" />
</TestTypeSpecific>
</Execution>
<Properties>
@artisticcheese
artisticcheese / webtest1.xml
Created August 10, 2017 17:30
webtest1.xml
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="WebTest1" Id="2b0301fa-6605-4d91-9c11-9798ac868ba5" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="True" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="GET" Guid="1ffa095e-785d-4935-ac00-ecdf45081b34" Version="1.1" Url="{{EndpointName}}/" ThinkTime="0" Timeout="300" ParseDependentRequests="False" FollowRedirects="False" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="301" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
<Request Method="GET" Guid="1ffa095e-785d-4935-ac00-ecdf45081b34" Version="1.1" Url="{{EndpointName}}/mssplus.txt" ThinkTime="0" Timeout="300" ParseDependentRequests="False" FollowRedirects="False" RecordResult="Tr
param
(
$tool = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\MSTest.exe",
$path = $psscriptroot,
$item = "$path\webtest1.webtest",
$results = "$path\webtest.trx",
$testsettings = "$path\Local.testsettings",
$expectedReleaseHeader = "webredirect:20170726_1050",
$urlTest = "http://10.45.122.51:8080"
@artisticcheese
artisticcheese / install.ps1
Last active September 9, 2017 16:55
PS1 file to install .NET core on nanoserver
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
<#
.SYNOPSIS
Installs dotnet cli
.DESCRIPTION
Installs dotnet cli. If dotnet installation already exists in the given directory
@artisticcheese
artisticcheese / a.ps1
Created September 9, 2017 19:36
Create GMSA account
Import-module ActiveDirectory
Add-KdsRootKey –EffectiveTime ((get-date).addhours(-10));
New-ADServiceAccount -Name containerhost -DNSHostName servicefabric.ad.local -PrincipalsAllowedToRetrieveManagedPassword "Domain Controllers",
"domain admins", "CN=Container Hosts,CN=Builtin, DC=ad, DC=local" -KerberosEncryptionType RC4, AES128, AES256
@artisticcheese
artisticcheese / a.ps1
Created September 9, 2017 19:57
Enable GMSA account
Enable-WindowsOptionalFeature -FeatureName ActiveDirectory-Powershell -online -all
Get-ADServiceAccount -Identity containerhost
Install-ADServiceAccount -Identity containerhost
Test-AdServiceAccount -Identity containerhost
@artisticcheese
artisticcheese / a.ps1
Last active September 9, 2017 20:42
GMSa
Invoke-WebRequest "https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/live/windows-server-container-tools/ServiceAccounts/CredentialSpec.psm1" -UseBasicParsing -OutFile $env:TEMP\cred.psm1
import-module $env:temp\cred.psm1
New-CredentialSpec -Name win -AccountName containerhost
#This will return location and name of JSON file
Get-CredentialSpec
Name Path
---- ----
win C:\ProgramData\docker\CredentialSpecs\win.json