Skip to content

Instantly share code, notes, and snippets.

@mrsi
mrsi / usergen.ps1
Created August 9, 2016 14:07
A PowerShell script to create a predictable list of sample active directory users and a sample active directory layout
function Create-UserList {
<#
.SYNOPSIS
This function provisions a predictable list of AD users and a typical AD structure for testing. Based on a script
from www.sharepointryan.com: https://sharepointryan.com/2012/03/14/creating-random-demo-users-in-active-directory-using-powershell/
.PARAMETER NumberOfUsers
The number of users to provision.
.EXAMPLE
PS C:\>Create-UserList -NumberOfUsers 50
@mrsi
mrsi / autounattend.xml
Created August 9, 2016 13:44
An AutoUnattend file that quickly builds a Windows 2012r2 server with the password Cangetinwin1
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-US</UserLocale>
</component>
@mrsi
mrsi / getPutSharedState.js
Created June 22, 2016 16:37
Add to shared state from an OpenAM authentication script
//get username and password from shared state
var someUserName = sharedState.get("javax.security.auth.login.name");
var somePassword = sharedState.get("javax.security.auth.login.password");
//set the username and password for other authentication modules to use
sharedState.put("javax.security.auth.login.password",someUserName);
sharedState.put("javax.security.auth.login.password",somePassword);