Skip to content

Instantly share code, notes, and snippets.

@rpunt
rpunt / 01-preseed-LVM-on-software-RAID.sh
Last active December 14, 2015 19:29
# This is a preseed partman recipe that will later allow the created on # LVM-on-software-RAID, somethat that wasn't possible directly in the # preseed at the time (~2003)
# This is a preseed partman recipe that will later allow the created on
# LVM-on-software-RAID, somethat that wasn't possible directly in the
# preseed at the time (~2003)
d-i lvmcfg/activevg boolean false
d-i lvmcfg/vgdelete_names select vg00
d-i lvmcfg/vgcreate_name string vg00
d-i lvmcfg/vgdelete_confirm boolean true
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
@rpunt
rpunt / Verify User Credentials.ps1
Last active December 14, 2015 19:09
Verify the user running the script is a local admin before proceeding
[CmdletBinding()]
param (
[parameter(Mandatory=$true)][string]$adminuser,
[parameter(Mandatory=$true)][string]$adminpassword
)
$computer = gc env:computername
# did you enter valid credentials for a local user?
[Reflection.Assembly]::LoadFile('C:\Windows\assembly\GAC_MSIL\System.DirectoryServices\2.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll')
@rpunt
rpunt / PowerShell Console Transcript.ps1
Last active December 14, 2015 19:09
Writes a log of the console output from a powershell script to $PWD. Very useful for unattended scripts.
$log=Join-Path (Get-ChildItem $MyInvocation.MyCommand.Definition).Directory (Get-ChildItem $MyInvocation.MyCommand.Definition).Basename
Start-Transcript "$log.log"
@rpunt
rpunt / 01-install-xenapp-6.ps1
Last active June 21, 2017 18:02
A fully-automated, silent install for XenApp 6 Enterprise on Server 2008 R2.
# This install assumes a couple things:
#
# 1. You're logged in as a local admin, per Citrix recommendations
# 2. These script files are store in d:\software\citrix6
# 3. The installation media for XenApp 6 has been unpacked in d:\software\citrix6\citrix6
# 4. The MSIs for Hotfix Rollup 2 and Profile Manager are located in d:\software\citrix6\citrix6\addons
# (these can be excluded by skipping "04-01-install-patches.bat"
#
# This install occurs across four reboots, and is complete unattended; you can kick it off
# when logged in via RDP or at the console, and let it run to completion. Run time is