Vmware

Aus SchnallIchNet
Wechseln zu: Navigation, Suche


Clone System

1)	Shut down the VM
2)	Clone the VM
3)	Disconnect the NIC
4)	Bring up the VM
Win10)  Run uninstall.ps1 script below, to uninstall unprovisioned AppStore Apps
5)	Run sysprep /generalize
        cd %WINDIR%\system32\sysprep; ./sysprep /generalize
6)	Assign new workstation name / admin pw
7)	Configure network / Connect NIC
8)	Join to domain

Uninstall.ps1

# Get the list of provisioned packages
$provisioned = Get-AppxProvisionedPackage -online

# Check each installed app
$count = 0

for ($i=1; $i -ile 2; $i++) {
  # Check each app (two loops just in case there are dependencies that can't be removed until the
  # main app is removed)
  Get-AppxPackage | ? {$_.SignatureKind -ne 'System'} | ForEach-Object {
    $current = $_
    $found = $provisioned | ? {$_.DisplayName -eq $current.Name -and $_.Version -eq $current.Version}
    if ($found.Count -eq 0)
    {
      Write-Host "$($current.Name) version $($current.Version) is not provisioned, removing."
      Remove-AppxPackage -Package $current.PackageFullName
      $count++
    }
  }
}