├── .gitattributes ├── .gitignore ├── Bootstrap.ini ├── Convert-VIAWIM2VHD.ps1 ├── CustomSettings.ini ├── Dev ├── ImageFactoryV3-ConvertToVHD.ps1 ├── ImageFactoryV3-GetallTaskSequences.ps1 └── ImageFactoryV3-Test.ps1 ├── ImageFactoryV3-Build.ps1 ├── ImageFactoryV3-ConvertToVHD.ps1 ├── ImageFactoryV3-Verify-Build.ps1 ├── ImageFactoryV3-Verify-CleanupVMs.ps1 ├── ImageFactoryV3-Verify-ShowContent.ps1 ├── ImageFactoryV3.xml ├── README.md └── log.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files we want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.md text 7 | *.gitattributes text 8 | 9 | # Declare files that will always have CRLF line endings on checkout. 10 | *.ps1 text eol=crlf 11 | *.psm1 text eol=crlf 12 | *.psd1 text eol=crlf 13 | *.psc1 text eol=crlf 14 | *.ps1xml text eol=crlf 15 | *.clixml text eol=crlf 16 | *.xml text eol=crlf 17 | *.txt text eol=crlf 18 | 19 | # Denote all files that are truly binary and should not be mergeable. 20 | *.dll binary 21 | *.exe binary 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | desktop.ini 3 | *.log 4 | *.bak 5 | *.cache 6 | *.sublime-* 7 | log.txt 8 | log.txt 9 | log.txt 10 | log.txt 11 | -------------------------------------------------------------------------------- /Bootstrap.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | Priority=Default 3 | 4 | [Default] 5 | DeployRoot=\\SERVER\SHARE 6 | UserDomain=DOMAIN 7 | UserID=USER 8 | UserPassword=PASSWORD 9 | SkipBDDWelcome=YES 10 | -------------------------------------------------------------------------------- /Convert-VIAWIM2VHD.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeploymentBunny/ImageFactoryV3ForHyper-V/c137072339092aa28ab19b7d20b476d745908853/Convert-VIAWIM2VHD.ps1 -------------------------------------------------------------------------------- /CustomSettings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | Priority=Serialnumber,Default 3 | 4 | [Default] 5 | _SMSTSORGNAME=%TaskSequenceName% 6 | UserDataLocation=NONE 7 | OSInstall=Y 8 | AdminPassword=PASSWORD 9 | TimeZoneName=Pacific Standard Time 10 | JoinWorkgroup=WORKGROUP 11 | HideShell=NO 12 | FinishAction=SHUTDOWN 13 | WSUSServer=http://server.network.com:8530 14 | ApplyGPOPack=NO 15 | SLShare=\\SERVER\Logs$ 16 | SLShareDynamicLogging=\\SERVER\Logs$ 17 | EventShare=\\SERVER\EventShare$ 18 | ComputerBackupLocation=NETWORK 19 | BackupShare=\\SERVER\MDTBuildLab$ 20 | BackupDir=Captures 21 | 22 | SkipAdminPassword=YES 23 | SkipProductKey=YES 24 | SkipComputerName=YES 25 | SkipDomainMembership=YES 26 | SkipUserData=YES 27 | SkipLocaleSelection=YES 28 | SkipTaskSequence=NO 29 | SkipTimeZone=YES 30 | SkipBitLocker=YES 31 | SkipSummary=YES 32 | SkipRoles=YES 33 | SkipCapture=NO 34 | SkipFinalSummary=YES 35 | 36 | -------------------------------------------------------------------------------- /Dev/ImageFactoryV3-ConvertToVHD.ps1: -------------------------------------------------------------------------------- 1 | $DateTime = (Get-Date).ToString('yyyyMMdd') 2 | $CaptureFolder = "D:\MDTBuildLab\Captures" 3 | $VHDxFolder = "C:\Setup\VHD\$DateTime" 4 | $UEFI = $true 5 | $BIOS = $false 6 | New-Item -Path $VHDxFolder -ItemType Directory -Force 7 | 8 | $wims = Get-ChildItem -Path $CaptureFolder -Filter *.wim 9 | foreach($wim in $wims){ 10 | $WindowsImage = Get-WindowsImage -ImagePath $wim.FullName 11 | if ($WindowsImage.ImageDescription -ne ""){ 12 | $ImageName = $WindowsImage.ImageDescription 13 | }else{ 14 | $ImageName = $wim.BaseName 15 | } 16 | 17 | Write-Host "Working on $ImageName" 18 | if($UEFI -eq $True){ 19 | #Create UEFI VHDX files 20 | $DestinationFile = $VHDxFolder + "\" + $ImageName + "_UEFI.vhdx" 21 | if((Test-Path -Path $DestinationFile) -ne $true){ 22 | Write-Host "About to create $DestinationFile" 23 | C:\Setup\ImageFactoryV3ForHyper-V\Convert-VIAWIM2VHD.ps1 -SourceFile $SourceFile -DestinationFile $DestinationFile -Disklayout UEFI -SizeInMB 80000 -Index 1 24 | }else{ 25 | Write-Host "$DestinationFile already exists" 26 | } 27 | } 28 | 29 | if($BIOS -eq $True){ 30 | #Create BIOS VHDX files 31 | $DestinationFile = $VHDxFolder + "\" + $ImageName + "_BIOS.vhdx" 32 | if((Test-Path -Path $DestinationFile) -ne $true){ 33 | Write-Host "About to create $DestinationFile" 34 | C:\Setup\ImageFactoryV3ForHyper-V\Convert-VIAWIM2VHD.ps1 -SourceFile $SourceFile -DestinationFile $DestinationFile -Disklayout BIOS -SizeInMB 80000 -Index 1 35 | }else{ 36 | Write-Host "$DestinationFile already exists" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Dev/ImageFactoryV3-GetallTaskSequences.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Short description 4 | .DESCRIPTION 5 | Long description 6 | .EXAMPLE 7 | Example of how to use this cmdlet 8 | .EXAMPLE 9 | Another example of how to use this cmdlet 10 | #> 11 | 12 | 13 | 14 | [cmdletbinding(SupportsShouldProcess=$True)] 15 | 16 | Param( 17 | ) 18 | 19 | BREAK 20 | 21 | Function Get-VIARefTaskSequence 22 | { 23 | Param( 24 | $RefTaskSequenceFolder 25 | ) 26 | $RefTaskSequences = Get-ChildItem $RefTaskSequenceFolder 27 | Foreach($RefTaskSequence in $RefTaskSequences){ 28 | New-Object PSObject -Property @{ 29 | TaskSequenceID = $RefTaskSequence.ID 30 | Name = $RefTaskSequence.Name 31 | Comments = $RefTaskSequence.Comments 32 | Version = $RefTaskSequence.Version 33 | Enabled = $RefTaskSequence.enable 34 | LastModified = $RefTaskSequence.LastModifiedTime 35 | } 36 | } 37 | } 38 | 39 | Function Test-VIAHypervConnection 40 | { 41 | Param( 42 | $Computername, 43 | $ISOFolder, 44 | $VMFolder, 45 | $VMSwitchName 46 | ) 47 | #Verify SMB access 48 | $Result = Test-NetConnection -ComputerName $Computername -CommonTCPPort SMB 49 | If ($Result.TcpTestSucceeded -eq $true){Write-Verbose "SMB Connection to $Computername is ok"}else{Write-Warning "SMB Connection to $Computername is NOT ok";BREAK} 50 | 51 | #Verify WinRM access 52 | $Result = Test-NetConnection -ComputerName $Computername -CommonTCPPort WINRM 53 | If ($Result.TcpTestSucceeded -eq $true){Write-Verbose "WINRM Connection to $Computername is ok"}else{Write-Warning "WINRM Connection to $Computername is NOT ok";BREAK} 54 | 55 | #Verify that Microsoft-Hyper-V-Management-PowerShell is installed 56 | Invoke-Command -ComputerName $Computername -ScriptBlock { 57 | $Result = (Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell) 58 | Write-Verbose "$($Result.DisplayName) is $($Result.State)" 59 | If($($Result.State) -ne "Enabled"){Write-Warning "$($Result.DisplayName) is not Enabled";BREAK} 60 | } 61 | 62 | #Verify that Microsoft-Hyper-V-Management-PowerShell is installed 63 | Invoke-Command -ComputerName $Computername -ScriptBlock { 64 | $Result = (Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V) 65 | If($($Result.State) -ne "Enabled"){Write-Warning "$($Result.DisplayName) is not Enabled";BREAK} 66 | } 67 | 68 | #Verify that Hyper-V is running 69 | Invoke-Command -ComputerName $Computername -ScriptBlock { 70 | $Result = (Get-Service -Name vmms) 71 | Write-Verbose "$($Result.DisplayName) is $($Result.Status)" 72 | If($($Result.Status) -ne "Running"){Write-Warning "$($Result.DisplayName) is not Running";BREAK} 73 | } 74 | 75 | #Verify that the ISO Folder is created 76 | Invoke-Command -ComputerName $Computername -ScriptBlock { 77 | Param( 78 | $ISOFolder 79 | ) 80 | $result = New-Item -Path $ISOFolder -ItemType Directory -Force 81 | } -ArgumentList $ISOFolder 82 | 83 | #Verify that the VM Folder is created 84 | Invoke-Command -ComputerName $Computername -ScriptBlock { 85 | Param( 86 | $VMFolder 87 | ) 88 | $result = New-Item -Path $VMFolder -ItemType Directory -Force 89 | } -ArgumentList $VMFolder 90 | 91 | #Verify that the VMSwitch exists 92 | Invoke-Command -ComputerName $Computername -ScriptBlock { 93 | Param( 94 | $VMSwitchName 95 | ) 96 | if(((Get-VMSwitch | Where-Object -Property Name -EQ -Value $VMSwitchName).count) -eq "1"){Write-Verbose "Found $VMSwitchName"}else{Write-Warning "No swtch with the name $VMSwitchName found";Break} 97 | } -ArgumentList $VMSwitchName 98 | Return $true 99 | } 100 | 101 | #Inititial Settings 102 | Write-Verbose "Imagefactory 3.1 (Hyper-V)" 103 | $XMLFile = "C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml" 104 | Import-Module 'C:\Program Files\Microsoft Deployment Toolkit\Bin\MicrosoftDeploymentToolkit.psd1' 105 | 106 | # Read Settings from XML 107 | Write-Verbose "Reading from $XMLFile" 108 | [xml]$Settings = Get-Content $XMLFile 109 | 110 | #Verify Connection to DeploymentRoot 111 | $Result = Test-Path -Path $Settings.Settings.MDT.DeploymentShare 112 | If($Result -ne $true){Write-Warning "Cannot access $($Settings.Settings.MDT.DeploymentShare) , will break";break} 113 | 114 | #Connect to MDT 115 | $Root = $Settings.Settings.MDT.DeploymentShare 116 | $MDTPSDrive = New-PSDrive -Name MDT -PSProvider MDTProvider -Root $Root -ErrorAction Stop 117 | Write-Verbose "Connected to $($MDTPSDrive.Root)" 118 | 119 | #Get MDT Settings 120 | $MDTSettings = Get-ItemProperty MDT: 121 | 122 | #Update boot image 123 | Write-Verbose "Updating boot image, please wait" 124 | Update-MDTDeploymentShare -Path MDT: -ErrorAction Stop 125 | 126 | #Verify access to boot image 127 | $MDTImage = $($Settings.Settings.MDT.DeploymentShare) + "\boot\" + $($MDTSettings.'Boot.x86.LiteTouchISOName') 128 | if((Test-Path -Path $MDTImage) -eq $true){Write-Verbose "Access to $MDTImage is ok"} 129 | 130 | #Get TaskSequences 131 | $RefTaskSequenceIDs = (Get-VIARefTaskSequence -RefTaskSequenceFolder "MDT:\Task Sequences\$($Settings.Settings.MDT.RefTaskSequenceFolderName)" | where Enabled -EQ $true).TasksequenceID 132 | Write-Verbose "Found $($RefTaskSequenceIDs.count) TaskSequences to work on" 133 | 134 | #check task sequence count 135 | if($RefTaskSequenceIDs.count -eq 0){Write-Warning "Sorry, could not find any TaskSequences to work with";BREAK} 136 | 137 | #Verify Connection to Hyper-V host 138 | $Result = Test-VIAHypervConnection -Computername $Settings.Settings.HyperV.Computername -ISOFolder $Settings.Settings.HyperV.ISOLocation -VMFolder $Settings.Settings.HyperV.VMLocation -VMSwitchName $Settings.Settings.HyperV.SwitchName 139 | If($Result -ne $true){Write-Warning "$($Settings.Settings.HyperV.Computername) is not ready, will break";break} 140 | 141 | #Upload boot image to Hyper-V host 142 | $DestinationFolder = "\\" + $($Settings.Settings.HyperV.Computername) + "\" + $($Settings.Settings.HyperV.ISOLocation -replace ":","$") 143 | Copy-Item -Path $MDTImage -Destination $DestinationFolder -Force 144 | 145 | #Create the VM's on Host 146 | Foreach($Ref in $RefTaskSequenceIDs){ 147 | $VMName = $ref 148 | $VMMemory = [int]$($Settings.Settings.HyperV.StartUpRAM) * 1GB 149 | $VMPath = $($Settings.Settings.HyperV.VMLocation) 150 | $VMBootimage = $($Settings.Settings.HyperV.ISOLocation) + "\" + $($MDTImage | Split-Path -Leaf) 151 | $VMVHDSize = [int]$($Settings.Settings.HyperV.VHDSize) * 1GB 152 | $VMVlanID = $($Settings.Settings.HyperV.VLANID) 153 | $VMVCPU = $($Settings.Settings.HyperV.NoCPU) 154 | $VMSwitch = $($Settings.Settings.HyperV.SwitchName) 155 | Invoke-Command -ComputerName $($Settings.Settings.HyperV.Computername) -ScriptBlock { 156 | Param( 157 | $VMName, 158 | $VMMemory, 159 | $VMPath, 160 | $VMBootimage, 161 | $VMVHDSize, 162 | $VMVlanID, 163 | $VMVCPU, 164 | $VMSwitch 165 | ) 166 | Write-Verbose "Hyper-V host is $env:COMPUTERNAME" 167 | Write-Verbose "Working on $VMName" 168 | #Check if VM exist 169 | if(!((Get-VM | Where-Object -Property Name -EQ -Value $VMName).count -eq 0)){Write-Warning -Message "VM exist";Break} 170 | 171 | #Create VM 172 | $VM = New-VM -Name $VMName -MemoryStartupBytes $VMMemory -Path $VMPath -NoVHD -Generation 1 173 | Write-Verbose "$($VM.Name) is created" 174 | 175 | #Connect to VMSwitch 176 | Connect-VMNetworkAdapter -VMNetworkAdapter (Get-VMNetworkAdapter -VM $VM) -SwitchName $VMSwitch 177 | Write-Verbose "$($VM.Name) is connected to $VMSwitch" 178 | 179 | #Set vCPU 180 | if($VMVCPU -ne "1"){ 181 | $Result = Set-VMProcessor -Count $VMVCPU -VM $VM -Passthru 182 | Write-Verbose "$($VM.Name) has $($Result.count) vCPU" 183 | } 184 | 185 | #Set VLAN 186 | If($VMVlanID -ne "0"){ 187 | $Result = Set-VMNetworkAdapterVlan -VlanId $VMVlanID -Access -VM $VM -Passthru 188 | Write-Verbose "$($VM.Name) is configured for VLANid $($Result.NativeVlanId)" 189 | } 190 | 191 | #Create empty disk 192 | $VHD = $VMName + ".vhdx" 193 | $result = New-VHD -Path "$VMPath\$VMName\Virtual Hard Disks\$VHD" -SizeBytes $VMVHDSize -Dynamic -ErrorAction Stop 194 | Write-Verbose "$($result.Path) is created for $($VM.Name)" 195 | 196 | #Add VHDx 197 | $result = Add-VMHardDiskDrive -VMName $VMName -Path "$VMPath\$VMName\Virtual Hard Disks\$VHD" -Passthru 198 | Write-Verbose "$($result.Path) is attached to $VMName" 199 | 200 | #Connect ISO 201 | $result = Set-VMDvdDrive -VMName $VMName -Path $VMBootimage -Passthru 202 | Write-Verbose "$($result.Path) is attached to $VMName" 203 | 204 | #Set Notes 205 | Set-VM -VMName $VMName -Notes "REFIMAGE" 206 | 207 | } -ArgumentList $VMName,$VMMemory,$VMPath,$VMBootimage,$VMVHDSize,$VMVlanID,$VMVCPU,$VMSwitch 208 | } 209 | 210 | #Remove old WIM files in the capture folder 211 | Foreach($Ref in $RefTaskSequenceIDs){ 212 | $FullRefPath = $(("$Root\Captures\$ref") + ".wim") 213 | if((Test-Path -Path $FullRefPath) -eq $true){ 214 | Remove-Item -Path $FullRefPath -Force -ErrorAction Stop 215 | } 216 | } 217 | 218 | #Start VM's on Host 219 | Invoke-Command -ComputerName $($Settings.Settings.HyperV.Computername) -ScriptBlock { 220 | Param( 221 | $ConcurrentRunningVMs 222 | ) 223 | #Print out settings 224 | Write-Output "ConcurrentRunningVMs is set to: $ConcurrentRunningVMs" 225 | 226 | #Get the VMs as Objects 227 | $RefVMs = Get-VM | Where-Object -Property Notes -Like -Value "REFIMAGE" 228 | foreach($RefVM in $RefVMs){ 229 | Write-Verbose "REFVM $($RefVM.Name) is allocated to $($RefVM.ComputerName) at $($refvm.ConfigurationLocation)" 230 | } 231 | 232 | #Get the VMs as Objects 233 | $RefVMs = Get-VM | Where-Object -Property Notes -Like -Value "REFIMAGE" 234 | foreach($RefVM in $RefVMs){ 235 | $StartedVM = Start-VM -VMName $RefVM.Name 236 | Write-Verbose "Starting $($StartedVM.name)" 237 | Do 238 | { 239 | $RunningVMs = $((Get-VM | Where-Object -Property Notes -EQ -Value "REFIMAGE" | Where-Object -Property State -EQ -Value Running)) 240 | Write-Output "Currently running VM's : $($RunningVMs.Name) at $(Get-Date)" 241 | Start-Sleep -Seconds "30" 242 | 243 | } 244 | While((Get-VM | Where-Object -Property Notes -EQ -Value "REFIMAGE" | Where-Object -Property State -EQ -Value Running).Count -gt ($ConcurrentRunningVMs - 1)) 245 | } 246 | } -ArgumentList $($Settings.Settings.ConcurrentRunningVMs) 247 | 248 | #Wait until they are done 249 | Invoke-Command -ComputerName $($Settings.Settings.HyperV.Computername) -ScriptBlock { 250 | Do{ 251 | $RunningVMs = $((Get-VM | Where-Object -Property Notes -EQ -Value "REFIMAGE" | Where-Object -Property State -EQ -Value Running)) 252 | Write-Output "Currently running VM's : $($RunningVMs.name) at $(Get-Date)" 253 | Start-Sleep -Seconds "30" 254 | 255 | }until((Get-VM | Where-Object -Property Notes -EQ -Value "REFIMAGE" | Where-Object -Property State -EQ -Value Running).count -eq '0') 256 | } 257 | 258 | #Cleanup VMs 259 | Invoke-Command -ComputerName $($Settings.Settings.HyperV.Computername) -ScriptBlock { 260 | $RefVMs = Get-VM | Where-Object -Property Notes -EQ -Value "REFIMAGE" 261 | Foreach($RefVM in $RefVMs){ 262 | $VM = Get-VM -VMName $RefVM.Name 263 | Write-Verbose "Deleting $($VM.Name) on $($VM.Computername) at $($VM.ConfigurationLocation)" 264 | Remove-VM -VM $VM -Force 265 | Remove-Item -Path $VM.ConfigurationLocation -Recurse -Force 266 | } 267 | } 268 | -------------------------------------------------------------------------------- /Dev/ImageFactoryV3-Test.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeploymentBunny/ImageFactoryV3ForHyper-V/c137072339092aa28ab19b7d20b476d745908853/Dev/ImageFactoryV3-Test.ps1 -------------------------------------------------------------------------------- /ImageFactoryV3-Build.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeploymentBunny/ImageFactoryV3ForHyper-V/c137072339092aa28ab19b7d20b476d745908853/ImageFactoryV3-Build.ps1 -------------------------------------------------------------------------------- /ImageFactoryV3-ConvertToVHD.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | ImageFactory 3.3 4 | .DESCRIPTION 5 | ImageFactory 3.3 6 | .EXAMPLE 7 | ImageFactoryV3-ConvertToVHD.ps1 8 | .NOTES 9 | Created: 2016-11-24 10 | Version: 3.1 11 | 12 | Updated: 2017-02-23 13 | Version: 3.2 14 | 15 | Updated: 2017-09-27 16 | Version: 3.3 17 | 18 | 19 | Author - Mikael Nystrom 20 | Twitter: @mikael_nystrom 21 | Blog : http://deploymentbunny.com 22 | 23 | Disclaimer: 24 | This script is provided 'AS IS' with no warranties, confers no rights and 25 | is not supported by the author. 26 | 27 | This script uses the PsIni module: 28 | Blog : http://oliver.lipkau.net/blog/ 29 | Source : https://github.com/lipkau/PsIni 30 | http://gallery.technet.microsoft.com/scriptcenter/ea40c1ef-c856-434b-b8fb-ebd7a76e8d91 31 | 32 | .LINK 33 | http://www.deploymentbunny.com 34 | #> 35 | 36 | 37 | $DateTime = (Get-Date).ToString('yyyyMMdd') 38 | $CaptureFolder = "D:\MDTBuildLab\Captures" 39 | $VHDxFolder = "C:\Setup\VHD\$DateTime" 40 | $UEFI = $true 41 | $BIOS = $false 42 | New-Item -Path $VHDxFolder -ItemType Directory -Force 43 | 44 | $wims = Get-ChildItem -Path $CaptureFolder -Filter *.wim 45 | foreach($wim in $wims){ 46 | $WindowsImage = Get-WindowsImage -ImagePath $wim.FullName 47 | if ($WindowsImage.ImageDescription -ne ""){ 48 | $ImageName = $WindowsImage.ImageDescription 49 | }else{ 50 | $ImageName = $wim.BaseName 51 | } 52 | 53 | Write-Host "Working on $ImageName" 54 | if($UEFI -eq $True){ 55 | #Create UEFI VHDX files 56 | $DestinationFile = $VHDxFolder + "\" + $ImageName + "_UEFI.vhdx" 57 | if((Test-Path -Path $DestinationFile) -ne $true){ 58 | Write-Host "About to create $DestinationFile" 59 | C:\Setup\ImageFactoryV3ForHyper-V\Convert-VIAWIM2VHD.ps1 -SourceFile $SourceFile -DestinationFile $DestinationFile -Disklayout UEFI -SizeInMB 80000 -Index 1 60 | }else{ 61 | Write-Host "$DestinationFile already exists" 62 | } 63 | } 64 | 65 | if($BIOS -eq $True){ 66 | #Create BIOS VHDX files 67 | $DestinationFile = $VHDxFolder + "\" + $ImageName + "_BIOS.vhdx" 68 | if((Test-Path -Path $DestinationFile) -ne $true){ 69 | Write-Host "About to create $DestinationFile" 70 | C:\Setup\ImageFactoryV3ForHyper-V\Convert-VIAWIM2VHD.ps1 -SourceFile $SourceFile -DestinationFile $DestinationFile -Disklayout BIOS -SizeInMB 80000 -Index 1 71 | }else{ 72 | Write-Host "$DestinationFile already exists" 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /ImageFactoryV3-Verify-Build.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeploymentBunny/ImageFactoryV3ForHyper-V/c137072339092aa28ab19b7d20b476d745908853/ImageFactoryV3-Verify-Build.ps1 -------------------------------------------------------------------------------- /ImageFactoryV3-Verify-CleanupVMs.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | ImageFactory 3.3 4 | .DESCRIPTION 5 | ImageFactory 3.3 6 | .EXAMPLE 7 | ImageFactoryV3-Verify-CleanupVMs.ps1 8 | .NOTES 9 | Created: 2016-11-24 10 | Version: 3.1 11 | 12 | Updated: 2017-02-23 13 | Version: 3.2 14 | 15 | Updated: 2017-09-27 16 | Version: 3.3 17 | 18 | 19 | Author - Mikael Nystrom 20 | Twitter: @mikael_nystrom 21 | Blog : http://deploymentbunny.com 22 | 23 | Disclaimer: 24 | This script is provided 'AS IS' with no warranties, confers no rights and 25 | is not supported by the author. 26 | 27 | This script uses the PsIni module: 28 | Blog : http://oliver.lipkau.net/blog/ 29 | Source : https://github.com/lipkau/PsIni 30 | http://gallery.technet.microsoft.com/scriptcenter/ea40c1ef-c856-434b-b8fb-ebd7a76e8d91 31 | 32 | .LINK 33 | http://www.deploymentbunny.com 34 | #> 35 | 36 | #Cleanup Validate VMs 37 | Update-Log -Data "Cleanup Validate VMs" 38 | Invoke-Command -ComputerName $($Settings.Settings.HyperV.Computername) -ScriptBlock { 39 | $ValVMs = Get-VM | Where-Object -Property Notes -Like -Value "VALIDATE*" 40 | Foreach($ValVM in $ValVMs){ 41 | $VM = Get-VM -VMName $ValVM.Name 42 | Write-Verbose "Deleting $($VM.Name) on $($VM.Computername) at $($VM.ConfigurationLocation)" 43 | Remove-VM -VM $VM -Force 44 | Remove-Item -Path $VM.ConfigurationLocation -Recurse -Force 45 | } 46 | } 47 | 48 | #Cleanup Reference VMs 49 | Update-Log -Data "Cleanup Reference VMs" 50 | Invoke-Command -ComputerName $($Settings.Settings.HyperV.Computername) -ScriptBlock { 51 | $ValVMs = Get-VM | Where-Object -Property Notes -Like -Value "REFIMAGE*" 52 | Foreach($ValVM in $ValVMs){ 53 | $VM = Get-VM -VMName $ValVM.Name 54 | Write-Verbose "Deleting $($VM.Name) on $($VM.Computername) at $($VM.ConfigurationLocation)" 55 | Remove-VM -VM $VM -Force 56 | Remove-Item -Path $VM.ConfigurationLocation -Recurse -Force 57 | } 58 | } -------------------------------------------------------------------------------- /ImageFactoryV3-Verify-ShowContent.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | ImageFactory 3.3 4 | .DESCRIPTION 5 | ImageFactory 3.3 6 | .EXAMPLE 7 | ImageFactoryV3-Verify-ShowContent.ps1 8 | .NOTES 9 | Created: 2016-11-24 10 | Version: 3.1 11 | 12 | Updated: 2017-02-23 13 | Version: 3.2 14 | 15 | Updated: 2017-09-27 16 | Version: 3.3 17 | 18 | Author - Mikael Nystrom 19 | Twitter: @mikael_nystrom 20 | Blog : http://deploymentbunny.com 21 | 22 | Disclaimer: 23 | This script is provided 'AS IS' with no warranties, confers no rights and 24 | is not supported by the author. 25 | 26 | This script uses the PsIni module: 27 | Blog : http://oliver.lipkau.net/blog/ 28 | Source : https://github.com/lipkau/PsIni 29 | http://gallery.technet.microsoft.com/scriptcenter/ea40c1ef-c856-434b-b8fb-ebd7a76e8d91 30 | 31 | .LINK 32 | http://www.deploymentbunny.com 33 | #> 34 | Import-Module C:\Setup\Functions\VIAHypervModule.psm1 -Force -Verbose 35 | 36 | $adminPassword = "P@ssw0rd" 37 | $domainName = "VIAMONSTRA" 38 | $DomainAdminPassword = "P@ssw0rd" 39 | $ReportPath = "C:\Setup\ImageFactoryV3ForHyper-V" 40 | $LocalCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ".\Administrator", (ConvertTo-SecureString $adminPassword -AsPlainText -Force) 41 | $DomainCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "$($domainName)\Administrator", (ConvertTo-SecureString $DomainAdminPassword -AsPlainText -Force) 42 | 43 | $Items = Get-VM | Where-Object -Property Notes -Like -Value "VALIDATE*" 44 | foreach($item in $items){ 45 | Start-VM $item 46 | Wait-VIAVMIsRunning -VMname $item.Name 47 | Wait-VIAVMHaveICLoaded -VMname $item.Name 48 | Wait-VIAVMHaveIP -VMname $item.Name 49 | Wait-VIAVMHavePSDirect -VMname $item.Name -Credentials $LocalCred 50 | 51 | $Result = Invoke-Command -VMName $item.Name -Credential $LocalCred -ScriptBlock { 52 | $Hostname = Hostname.exe 53 | $Microsoft_BDD_Info = Get-WMIObject –Class Microsoft_BDD_Info | Select-Object CaptureMethod,CaptureTaskSequenceID,CaptureTaskSequenceName,CaptureTaskSequenceVersion,CaptureTimestamp,CaptureToolkitVersion 54 | $Win32_OperatingSystem = Get-WmiObject -Class Win32_OperatingSystem | Select-Object Caption,Buildnumber,CodeSet,CurrentTimeZone,MUILanguages,OSLanguage,Version 55 | $Win32_QuickFixEngineering = Get-WmiObject -class Win32_QuickFixEngineering | Select-Object HotFixID,Description,InstalledOn,InstalledBy 56 | $CurrentVersionUninstall = Get-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object DisplayName -ne $null | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate 57 | $AppxPackage = Get-AppxPackage | Select-Object Name,Version 58 | $WindowsOptionalFeature = Get-WindowsOptionalFeature -Online -LogPath "C:\dismlog.log" | Where-Object State -EQ Enabled | Select-Object FeatureName 59 | 60 | 61 | $Hash = [ordered]@{ 62 | HostName = $($Hostname); 63 | CaptureMethod = $($Microsoft_BDD_Info.CaptureMethod); 64 | CaptureTaskSequenceID = $($Microsoft_BDD_Info.CaptureTaskSequenceID); 65 | CaptureTaskSequenceName = $($Microsoft_BDD_Info.CaptureTaskSequenceName); 66 | CaptureTaskSequenceVersion = $($Microsoft_BDD_Info.CaptureTaskSequenceVersion); 67 | CaptureTimestamp = $($Microsoft_BDD_Info.CaptureTimestamp); 68 | CaptureToolkitVersion = $($Microsoft_BDD_Info.CaptureToolkitVersion); 69 | Caption = $($Win32_OperatingSystem.Caption); 70 | Buildnumber = $($Win32_OperatingSystem.Buildnumber); 71 | CodeSet = $($Win32_OperatingSystem.CodeSet); 72 | CurrentTimeZone = $($Win32_OperatingSystem.CurrentTimeZone); 73 | MUILanguages = $($Win32_OperatingSystem.MUILanguages); 74 | OSLanguage = $($Win32_OperatingSystem.OSLanguage); 75 | Version = $($Win32_OperatingSystem.Version); 76 | Win32_QuickFixEngineering = $($Win32_QuickFixEngineering); 77 | CurrentVersionUninstall = $($CurrentVersionUninstall); 78 | AppxPackage = $($AppxPackage); 79 | WindowsOptionalFeature = $($WindowsOptionalFeature); 80 | } 81 | $Data = New-Object PSObject -Property $Hash 82 | Return $Data 83 | } 84 | Stop-VM -VM $item 85 | 86 | #Create Report 87 | $ReportFile = New-Item -Path "$ReportPath\Report$($DateTime = (Get-Date).ToString('yyyyMMdd'))-$($Result.HostName).txt" -type File -Force 88 | Set-Content -Path $ReportFile -Value "HOSTNAME: $($Result.HostName)" 89 | Add-Content -Path $ReportFile -Value "CaptureMethod :$($Result.CaptureMethod)" 90 | Add-Content -Path $ReportFile -Value "CaptureTaskSequenceID: $($Result.CaptureTaskSequenceID)" 91 | Add-Content -Path $ReportFile -Value "CaptureTaskSequenceName: $($Result.CaptureTaskSequenceName)" 92 | Add-Content -Path $ReportFile -Value "CaptureTaskSequenceVersion: $($Result.CaptureTaskSequenceVersion)" 93 | Add-Content -Path $ReportFile -Value "CaptureTimestamp: $($Result.CaptureTimestamp)" 94 | Add-Content -Path $ReportFile -Value "CaptureToolkitVersion: $($Result.CaptureToolkitVersion)" 95 | Add-Content -Path $ReportFile -Value "Caption: $($Result.Caption)" 96 | Add-Content -Path $ReportFile -Value "Buildnumber: $($Result.Buildnumber)" 97 | Add-Content -Path $ReportFile -Value "CodeSet: $($Result.CodeSet)" 98 | Add-Content -Path $ReportFile -Value "CurrentTimeZone: $($Result.CurrentTimeZone)" 99 | Add-Content -Path $ReportFile -Value "MUILanguages: $($Result.MUILanguages)" 100 | Add-Content -Path $ReportFile -Value "OSLanguage: $($Result.OSLanguage)" 101 | Add-Content -Path $ReportFile -Value "Version: $($Result.Version)" 102 | foreach($Item in $Result.AppxPackage){ 103 | Add-Content -Path $ReportFile -Value "AppX: $($Item.Name) - $($Item.Version)" 104 | } 105 | foreach($Item in $Result.Win32_QuickFixEngineering){ 106 | Add-Content -Path $ReportFile -Value "HotFix: $($Item.HotFixID) - $($Item.Description) - $($Item.InstalledOn) - $($Item.InstalledBy)" 107 | } 108 | foreach($Item in $Result.CurrentVersionUninstall){ 109 | Add-Content -Path $ReportFile -Value "App: $($Item.DisplayName) - $($Item.DisplayVersion) - $($Item.Publisher) - $($Item.InstallDate)" 110 | } 111 | foreach($Item in $Result.WindowsOptionalFeature){ 112 | Add-Content -Path $ReportFile -Value "Feature: $($Item.FeatureName)" 113 | } 114 | } 115 | 116 | 117 | -------------------------------------------------------------------------------- /ImageFactoryV3.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 3 | 4 | D:\MDTBuildLab 5 | REF 6 | Validate 7 | Validate 8 | 9 | 10 | 4 11 | 0 12 | DEMOHOST03 13 | UplinkSwitchNAT 14 | D:\VMs 15 | C:\ISO 16 | 80 17 | 2 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ImageFactoryV3ForHyper-V 2 | ImageFactory V3.1 For Hyper-V 3 | 4 | The image factory creates reference images using Microsoft Deployment Toolkit and PowerShell. 5 | You run the script on the MDT server. The script will connect to a hyper-v host specified in the XML file and build one virtual machine for each task sequences in the REF folder. 6 | It will then grab the BIOS serial number from each virtual machine, inject it into customsettings.ini, start the virtual machines, run the build and capture process, turn off the virtual machine and remove them all. 7 | 8 | Modify the XML file to fit your enviroment and use the bootstrap.ini and customsettings.ini as sample files. 9 | 10 | You need the following PowerShell Module https://github.com/lipkau/PsIni 11 | /mike -------------------------------------------------------------------------------- /log.txt: -------------------------------------------------------------------------------- 1 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 02/23/2017 14:32:01 2 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 02/23/2017 14:32:01 3 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 02/23/2017 14:32:01 4 | IMF32, Importing modules, Information, 02/23/2017 14:32:01 5 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 02/23/2017 14:32:01 6 | IMF32, Verify Connection to DeploymentRoot, Information, 02/23/2017 14:32:01 7 | IMF32, Connect to MDT, Information, 02/23/2017 14:32:01 8 | IMF32, Connected to D:\MDTBuildLab, Information, 02/23/2017 14:32:01 9 | IMF32, Get MDT Settings, Information, 02/23/2017 14:32:01 10 | IMF32, Check if we should update the boot image, Information, 02/23/2017 14:32:01 11 | IMF32, Check if we should use MDTmonitoring, Information, 02/23/2017 14:32:01 12 | IMF32, Verify access to boot image, Information, 02/23/2017 14:32:01 13 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 02/23/2017 14:32:01 14 | IMF32, Get TaskSequences, Information, 02/23/2017 14:32:01 15 | IMF32, Found 1 TaskSequences to work on, Information, 02/23/2017 14:32:01 16 | IMF32, Get detailed info about the task sequences, Information, 02/23/2017 14:32:01 17 | IMF32, REFWS2016-003 Ref Windows Server 2016 x64 Standard - 10.0.14393.0 1.0, Information, 02/23/2017 14:32:01 18 | IMF32, Verify Connection to Hyper-V host, Information, 02/23/2017 14:32:01 19 | IMF32, Upload boot image to Hyper-V host, Information, 02/23/2017 14:32:19 20 | IMF32, Remove old WIM files in the capture folder, Information, 02/23/2017 14:32:19 21 | IMF32, Create the VM's on Host, Information, 02/23/2017 14:32:19 22 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 02/23/2017 14:32:28 23 | IMF32, Start VM's on Host, Information, 02/23/2017 14:32:30 24 | IMF32, ConcurrentRunningVMs is set to: 2, Information, 02/23/2017 14:32:30 25 | IMF32, Wait until they are done, Information, 02/23/2017 14:33:06 26 | IMF32, Cleanup VMs, Information, 02/23/2017 14:34:13 27 | IMF32, Update CustomSettings.ini, Information, 02/23/2017 14:34:17 28 | IMF32, Cleanup MDT Monitoring data, Information, 02/23/2017 14:34:17 29 | IMF32, Show the WIM's, Information, 02/23/2017 14:34:17 30 | IMF32, Could not find D:\MDTBuildLab\Captures\REFWS2016-003.wim, something went wrong, sorry, Warning, 02/23/2017 14:34:17 31 | IMF32, The script took 0:Days 0:Hours 2:Minutes to complete., Information, 02/23/2017 14:34:17 32 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 02/23/2017 14:34:37 33 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 02/23/2017 14:34:37 34 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 02/23/2017 14:34:37 35 | IMF32, Importing modules, Information, 02/23/2017 14:34:37 36 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 02/23/2017 14:34:37 37 | IMF32, Verify Connection to DeploymentRoot, Information, 02/23/2017 14:34:37 38 | IMF32, Connect to MDT, Information, 02/23/2017 14:34:37 39 | IMF32, Connected to D:\MDTBuildLab, Information, 02/23/2017 14:34:37 40 | IMF32, Get MDT Settings, Information, 02/23/2017 14:34:37 41 | IMF32, Check if we should update the boot image, Information, 02/23/2017 14:34:37 42 | IMF32, Check if we should use MDTmonitoring, Information, 02/23/2017 14:34:37 43 | IMF32, Verify access to boot image, Information, 02/23/2017 14:34:37 44 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 02/23/2017 14:34:37 45 | IMF32, Get TaskSequences, Information, 02/23/2017 14:34:37 46 | IMF32, Found 1 TaskSequences to work on, Information, 02/23/2017 14:34:37 47 | IMF32, Get detailed info about the task sequences, Information, 02/23/2017 14:34:37 48 | IMF32, REFWS2016-003 Ref Windows Server 2016 x64 Standard - 10.0.14393.0 1.0, Information, 02/23/2017 14:34:37 49 | IMF32, Verify Connection to Hyper-V host, Information, 02/23/2017 14:34:37 50 | IMF32, Upload boot image to Hyper-V host, Information, 02/23/2017 14:34:50 51 | IMF32, Remove old WIM files in the capture folder, Information, 02/23/2017 14:34:51 52 | IMF32, Create the VM's on Host, Information, 02/23/2017 14:34:51 53 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 02/23/2017 14:34:59 54 | IMF32, Start VM's on Host, Information, 02/23/2017 14:35:04 55 | IMF32, ConcurrentRunningVMs is set to: 2, Information, 02/23/2017 14:35:04 56 | IMF32, Wait until they are done, Information, 02/23/2017 14:35:41 57 | IMF32, Cleanup VMs, Information, 02/23/2017 14:37:20 58 | IMF32, Update CustomSettings.ini, Information, 02/23/2017 14:37:25 59 | IMF32, Cleanup MDT Monitoring data, Information, 02/23/2017 14:37:25 60 | IMF32, Show the WIM's, Information, 02/23/2017 14:37:25 61 | IMF32, Could not find D:\MDTBuildLab\Captures\REFWS2016-003.wim, something went wrong, sorry, Warning, 02/23/2017 14:37:25 62 | IMF32, The script took 0:Days 0:Hours 2:Minutes to complete., Information, 02/23/2017 14:37:25 63 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 03/06/2017 12:50:40 64 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 03/06/2017 12:50:40 65 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/06/2017 12:50:40 66 | IMF32, Importing modules, Information, 03/06/2017 12:50:40 67 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/06/2017 12:50:40 68 | IMF32, Verify Connection to DeploymentRoot, Information, 03/06/2017 12:50:40 69 | IMF32, Connect to MDT, Information, 03/06/2017 12:50:40 70 | IMF32, Connected to D:\MDTBuildLab, Information, 03/06/2017 12:50:40 71 | IMF32, Get MDT Settings, Information, 03/06/2017 12:50:55 72 | IMF32, Check if we should update the boot image, Information, 03/06/2017 12:50:55 73 | IMF32, Check if we should use MDTmonitoring, Information, 03/06/2017 12:50:55 74 | IMF32, Verify access to boot image, Information, 03/06/2017 12:50:55 75 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 03/06/2017 12:50:55 76 | IMF32, Get TaskSequences, Information, 03/06/2017 12:50:55 77 | IMF32, Found 1 TaskSequences to work on, Information, 03/06/2017 12:50:55 78 | IMF32, Get detailed info about the task sequences, Information, 03/06/2017 12:51:05 79 | IMF32, REFWS2016-003 Ref Windows Server 2016 x64 Standard - 10.0.14393.0 1.0, Information, 03/06/2017 12:51:05 80 | IMF32, Verify Connection to Hyper-V host, Information, 03/06/2017 12:51:11 81 | IMF32, Upload boot image to Hyper-V host, Information, 03/06/2017 12:51:23 82 | IMF32, Remove old WIM files in the capture folder, Information, 03/06/2017 12:51:57 83 | IMF32, Create the VM's on Host, Information, 03/06/2017 12:52:13 84 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 03/06/2017 12:52:25 85 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 03/06/2017 12:53:04 86 | IMF32, Importing modules, Information, 03/06/2017 12:53:21 87 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 03/06/2017 12:55:01 88 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 03/06/2017 12:55:01 89 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/06/2017 12:55:01 90 | IMF32, Importing modules, Information, 03/06/2017 12:55:01 91 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/06/2017 12:55:01 92 | IMF32, Verify Connection to DeploymentRoot, Information, 03/06/2017 12:55:01 93 | IMF32, Connect to MDT, Information, 03/06/2017 12:55:01 94 | IMF32, Get MDT Settings, Information, 03/06/2017 12:55:01 95 | IMF32, Check if we should update the boot image, Information, 03/06/2017 12:55:01 96 | IMF32, Check if we should use MDTmonitoring, Information, 03/06/2017 12:55:01 97 | IMF32, Verify access to boot image, Information, 03/06/2017 12:55:01 98 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 03/06/2017 12:55:01 99 | IMF32, Get TaskSequences, Information, 03/06/2017 12:55:01 100 | IMF32, Found 1 TaskSequences to work on, Information, 03/06/2017 12:55:01 101 | IMF32, Get detailed info about the task sequences, Information, 03/06/2017 12:55:01 102 | IMF32, REFWS2016-003 Ref Windows Server 2016 x64 Standard - 10.0.14393.0 1.0, Information, 03/06/2017 12:55:01 103 | IMF32, Verify Connection to Hyper-V host, Information, 03/06/2017 12:55:01 104 | IMF32, Upload boot image to Hyper-V host, Information, 03/06/2017 12:55:10 105 | IMF32, Remove old WIM files in the capture folder, Information, 03/06/2017 12:55:11 106 | IMF32, Create the VM's on Host, Information, 03/06/2017 12:55:16 107 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 03/06/2017 12:55:24 108 | IMF32, Cleanup VMs, Information, 03/06/2017 12:55:40 109 | IMF32, Update CustomSettings.ini, Information, 03/06/2017 12:55:54 110 | IMF32, Cleanup MDT Monitoring data, Information, 03/06/2017 12:56:02 111 | IMF32, Show the WIM's, Information, 03/06/2017 12:56:07 112 | IMF32, Could not find D:\MDTBuildLab\Captures\REFWS2016-003.wim, something went wrong, sorry, Warning, 03/06/2017 12:56:07 113 | IMF32, The script took 0:Days 0:Hours 1:Minutes to complete., Information, 03/06/2017 12:56:07 114 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 03/06/2017 13:42:11 115 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 03/06/2017 13:42:11 116 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/06/2017 13:42:11 117 | IMF32, Importing modules, Information, 03/06/2017 13:42:11 118 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/06/2017 13:42:11 119 | IMF32, Verify Connection to DeploymentRoot, Information, 03/06/2017 13:42:11 120 | IMF32, Connect to MDT, Information, 03/06/2017 13:42:11 121 | IMF32, Get MDT Settings, Information, 03/06/2017 13:42:11 122 | IMF32, Check if we should update the boot image, Information, 03/06/2017 13:42:11 123 | IMF32, Check if we should use MDTmonitoring, Information, 03/06/2017 13:42:11 124 | IMF32, Verify access to boot image, Information, 03/06/2017 13:42:11 125 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 03/06/2017 13:42:11 126 | IMF32, Get TaskSequences, Information, 03/06/2017 13:42:11 127 | IMF32, Found 1 TaskSequences to work on, Information, 03/06/2017 13:42:11 128 | IMF32, Get detailed info about the task sequences, Information, 03/06/2017 13:42:11 129 | IMF32, REFWS2016-003 Ref Windows Server 2016 x64 Standard - 10.0.14393.0 1.0, Information, 03/06/2017 13:42:11 130 | IMF32, Verify Connection to Hyper-V host, Information, 03/06/2017 13:42:11 131 | IMF32, Upload boot image to Hyper-V host, Information, 03/06/2017 13:42:20 132 | IMF32, Remove old WIM files in the capture folder, Information, 03/06/2017 13:42:21 133 | IMF32, Create the VM's on Host, Information, 03/06/2017 13:42:21 134 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 03/06/2017 13:42:28 135 | IMF32, Start VM's on Host, Information, 03/06/2017 13:42:29 136 | IMF32, ConcurrentRunningVMs is set to: 2, Information, 03/06/2017 13:42:29 137 | IMF32, Wait until they are done, Information, 03/06/2017 13:43:05 138 | IMF32, Cleanup VMs, Information, 03/06/2017 14:58:25 139 | IMF32, Update CustomSettings.ini, Information, 03/06/2017 14:58:29 140 | IMF32, Cleanup MDT Monitoring data, Information, 03/06/2017 14:58:29 141 | IMF32, Show the WIM's, Information, 03/06/2017 14:58:29 142 | IMF32, WIM: D:\MDTBuildLab\Captures\REFWS2016-003.wim, Information, 03/06/2017 14:58:29 143 | IMF32, The script took 0:Days 1:Hours 16:Minutes to complete., Information, 03/06/2017 14:58:29 144 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 03/09/2017 17:28:52 145 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 03/09/2017 17:28:52 146 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/09/2017 17:28:52 147 | IMF32, Importing modules, Information, 03/09/2017 17:28:58 148 | IMF32, Importing modules, Information, 03/09/2017 17:29:34 149 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/09/2017 17:29:37 150 | IMF32, Verify Connection to DeploymentRoot, Information, 03/09/2017 17:29:40 151 | IMF32, Connect to MDT, Information, 03/09/2017 17:29:53 152 | IMF32, Connected to D:\MDTBuildLab, Information, 03/09/2017 17:29:53 153 | IMF32, Get MDT Settings, Information, 03/09/2017 17:29:57 154 | IMF32, Check if we should update the boot image, Information, 03/09/2017 17:30:09 155 | IMF32, Check if we should use MDTmonitoring, Information, 03/09/2017 17:30:13 156 | IMF32, Verify access to boot image, Information, 03/09/2017 17:30:17 157 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 03/09/2017 17:30:17 158 | IMF32, Get TaskSequences, Information, 03/09/2017 17:30:21 159 | IMF32, Found 1 TaskSequences to work on, Information, 03/09/2017 17:30:21 160 | IMF32, Get detailed info about the task sequences, Information, 03/09/2017 17:30:28 161 | IMF32, REFWS2016-003 Ref Windows Server 2016 x64 Standard - 10.0.14393.0 1.0, Information, 03/09/2017 17:30:28 162 | IMF32, Verify Connection to Hyper-V host, Information, 03/09/2017 17:30:39 163 | IMF32, Upload boot image to Hyper-V host, Information, 03/09/2017 17:31:18 164 | IMF32, Remove old WIM files in the capture folder, Information, 03/09/2017 17:31:22 165 | IMF32, Create the VM's on Host, Information, 03/09/2017 17:31:40 166 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 03/09/2017 17:33:11 167 | IMF32, Start VM's on Host, Information, 03/09/2017 17:34:31 168 | IMF32, ConcurrentRunningVMs is set to: 2, Information, 03/09/2017 17:34:31 169 | IMF32, Wait until they are done, Information, 03/09/2017 17:35:31 170 | IMF32, Cleanup VMs, Information, 03/09/2017 17:36:09 171 | IMF32, Update CustomSettings.ini, Information, 03/09/2017 17:36:18 172 | IMF32, Cleanup MDT Monitoring data, Information, 03/09/2017 17:37:12 173 | IMF32, Show the WIM's, Information, 03/09/2017 17:37:12 174 | IMF32, Could not find D:\MDTBuildLab\Captures\REFWS2016-003.wim, something went wrong, sorry, Warning, 03/09/2017 17:37:12 175 | IMF32, The script took 0:Days 0:Hours 8:Minutes to complete., Information, 03/09/2017 17:37:12 176 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 03/25/2017 15:04:07 177 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 03/25/2017 15:04:07 178 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/25/2017 15:04:07 179 | IMF32, Importing modules, Information, 03/25/2017 15:04:07 180 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/25/2017 15:04:07 181 | IMF32, Verify Connection to DeploymentRoot, Information, 03/25/2017 15:04:07 182 | IMF32, Connect to MDT, Information, 03/25/2017 15:04:07 183 | IMF32, Connected to D:\MDTBuildLab, Information, 03/25/2017 15:04:07 184 | IMF32, Get MDT Settings, Information, 03/25/2017 15:04:07 185 | IMF32, Check if we should update the boot image, Information, 03/25/2017 15:04:07 186 | IMF32, Check if we should use MDTmonitoring, Information, 03/25/2017 15:04:07 187 | IMF32, Verify access to boot image, Information, 03/25/2017 15:04:07 188 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 03/25/2017 15:04:07 189 | IMF32, Get TaskSequences, Information, 03/25/2017 15:04:07 190 | IMF32, Found 1 TaskSequences to work on, Information, 03/25/2017 15:04:08 191 | IMF32, Get detailed info about the task sequences, Information, 03/25/2017 15:04:08 192 | IMF32, REFW10X64-001 Ref Windows 10 x64 - 10.0.14393.0 1.0, Information, 03/25/2017 15:04:08 193 | IMF32, Verify Connection to Hyper-V host, Information, 03/25/2017 15:04:08 194 | IMF32, Upload boot image to Hyper-V host, Information, 03/25/2017 15:04:12 195 | IMF32, Remove old WIM files in the capture folder, Information, 03/25/2017 15:04:14 196 | IMF32, Create the VM's on Host, Information, 03/25/2017 15:04:14 197 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 03/25/2017 15:04:14 198 | IMF32, Start VM's on Host, Information, 03/25/2017 15:04:14 199 | IMF32, ConcurrentRunningVMs is set to: 2, Information, 03/25/2017 15:04:14 200 | IMF32, Wait until they are done, Information, 03/25/2017 15:04:14 201 | IMF32, Cleanup VMs, Information, 03/25/2017 15:04:14 202 | IMF32, Update CustomSettings.ini, Information, 03/25/2017 15:04:14 203 | IMF32, Cleanup MDT Monitoring data, Information, 03/25/2017 15:04:14 204 | IMF32, Show the WIM's, Information, 03/25/2017 15:04:14 205 | IMF32, Could not find D:\MDTBuildLab\Captures\REFW10X64-001.wim, something went wrong, sorry, Warning, 03/25/2017 15:04:14 206 | IMF32, The script took 0:Days 0:Hours 0:Minutes to complete., Information, 03/25/2017 15:04:14 207 | IMF32, Imagefactory 3.2 (Hyper-V), Information, 03/25/2017 15:05:07 208 | IMF32, Logfile is C:\Setup\ImageFactoryV3ForHyper-V\log.txt, Information, 03/25/2017 15:05:07 209 | IMF32, XMLfile is C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/25/2017 15:05:07 210 | IMF32, Importing modules, Information, 03/25/2017 15:05:07 211 | IMF32, Reading from C:\setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml, Information, 03/25/2017 15:05:07 212 | IMF32, Verify Connection to DeploymentRoot, Information, 03/25/2017 15:05:07 213 | IMF32, Connect to MDT, Information, 03/25/2017 15:05:07 214 | IMF32, Get MDT Settings, Information, 03/25/2017 15:05:07 215 | IMF32, Check if we should update the boot image, Information, 03/25/2017 15:05:07 216 | IMF32, Check if we should use MDTmonitoring, Information, 03/25/2017 15:05:07 217 | IMF32, Verify access to boot image, Information, 03/25/2017 15:05:07 218 | IMF32, Access to D:\MDTBuildLab\boot\MDT Build Lab x86.iso is ok, Information, 03/25/2017 15:05:07 219 | IMF32, Get TaskSequences, Information, 03/25/2017 15:05:07 220 | IMF32, Found 1 TaskSequences to work on, Information, 03/25/2017 15:05:07 221 | IMF32, Get detailed info about the task sequences, Information, 03/25/2017 15:05:07 222 | IMF32, REFW10X64-001 Ref Windows 10 x64 - 10.0.14393.0 1.0, Information, 03/25/2017 15:05:07 223 | IMF32, Verify Connection to Hyper-V host, Information, 03/25/2017 15:05:07 224 | IMF32, Upload boot image to Hyper-V host, Information, 03/25/2017 15:05:09 225 | IMF32, Remove old WIM files in the capture folder, Information, 03/25/2017 15:05:11 226 | IMF32, Create the VM's on Host, Information, 03/25/2017 15:05:11 227 | IMF32, Get BIOS Serialnumber from each VM and update the customsettings.ini file, Information, 03/25/2017 15:05:11 228 | IMF32, Start VM's on Host, Information, 03/25/2017 15:05:11 229 | IMF32, ConcurrentRunningVMs is set to: 2, Information, 03/25/2017 15:05:11 230 | IMF32, Wait until they are done, Information, 03/25/2017 15:05:11 231 | IMF32, Cleanup VMs, Information, 03/25/2017 15:05:11 232 | IMF32, Update CustomSettings.ini, Information, 03/25/2017 15:05:11 233 | IMF32, Cleanup MDT Monitoring data, Information, 03/25/2017 15:05:11 234 | IMF32, Show the WIM's, Information, 03/25/2017 15:05:11 235 | IMF32, Could not find D:\MDTBuildLab\Captures\REFW10X64-001.wim, something went wrong, sorry, Warning, 03/25/2017 15:05:11 236 | IMF32, The script took 0:Days 0:Hours 0:Minutes to complete., Information, 03/25/2017 15:05:11 237 | --------------------------------------------------------------------------------