Vmware: Unterschied zwischen den Versionen

Aus SchnallIchNet
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „ == Clone System == <pre> 1) Shut down the VM 2) Clone the VM 3) Disconnect the NIC 4) Bring up the VM 5) Run sysprep /generalize cd %WINDIR%\system3…“)
 
Zeile 8: Zeile 8:
 
3) Disconnect the NIC
 
3) Disconnect the NIC
 
4) Bring up the VM
 
4) Bring up the VM
 +
Win10)  Run uninstall.ps1 script below, to uninstall unprovisioned AppStore Apps
 
5) Run sysprep /generalize
 
5) Run sysprep /generalize
 
         cd %WINDIR%\system32\sysprep; ./sysprep /generalize
 
         cd %WINDIR%\system32\sysprep; ./sysprep /generalize
Zeile 13: Zeile 14:
 
7) Configure network / Connect NIC
 
7) Configure network / Connect NIC
 
8) Join to domain
 
8) Join to domain
 +
</pre>
 +
 +
=== Uninstall.ps1 ===
 +
 +
<pre>
 +
# 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++
 +
    }
 +
  }
 +
}
 
</pre>
 
</pre>

Version vom 7. Dezember 2020, 15:15 Uhr


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++
    }
  }
}