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
{ | |
"variables": { | |
"name": "2019", | |
"guest_os_type": "windows9srv-64", | |
"iso_checksum": "7B463563206DCE275F2D3FF77AC36C430052FAE161CD4F8B31F3DC7AF1C3F418", | |
"iso_url": "file://C\\Users\\taylor\\Downloads\\en_windows_server_2019_x64_dvd_3c2cf1202.iso", | |
"iso_checksum_type": "sha256", | |
"answerfile": "answer_files/2019/Autounattend.xml", | |
"disk_size": "40960" | |
}, |
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
<?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"> | |
<SetupUILanguage> | |
<UILanguage>en-US</UILanguage> | |
</SetupUILanguage> | |
<InputLocale>en-US</InputLocale> | |
<SystemLocale>en-US</SystemLocale> |
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
{ | |
"variables": { | |
"name": "packer-ubuntu-1804", | |
"build_cpu_cores": "2", | |
"build_memory": "1024", | |
"cpu_cores": "1", | |
"memory": "512", | |
"disk_size": "20480", | |
"headless": "false", | |
"vm_hardware_version": "10", |
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 Get-ActivationStatus { | |
[CmdletBinding()] | |
param( | |
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[string]$ComputerName = $Env:COMPUTERNAME, | |
[System.Management.Automation.CredentialAttribute()]$Credential | |
) | |
process { | |
try { | |
# Load CimInstance in Server2003 Compatability Mode |
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 Get-LocalAdministrators { | |
param ([string]$computername=$env:computername, | |
[System.Management.Automation.CredentialAttribute()]$Credential | |
) | |
$computername = $computername.toupper() | |
$ADMINS = get-wmiobject -computername $computername -Credential $Credential -query "select * from win32_groupuser where GroupComponent=""Win32_Group.Domain='$computername',Name='administrators'""" | % {$_.partcomponent} | |
foreach ($ADMIN in $ADMINS) { | |
$admin = $admin.replace("\\$computername\root\cimv2:Win32_UserAccount.Domain=","") # trims the results for a user |