djfflow
Goto Top

Windows 10 1607 Upgrade per WSUS anpassen

Hallo,

wir haben einen WSUS und W10 1511 Pro Clients. Ich möchte nun die Clients per WSUS auf 1607 heben. Das entsprechende Update ist auch verfügbar.
Nun möchte ich dieses aber anpassen.
Es sollen zum Beispiel die Starmenüeinträge entfernt werden um diese ganzen Werbeapps entfernen.
Bisher haben wir über Powershell das Skript Pin-App benutzt. Dafür muss man aber den genauen Appnamen kennen. Dieser ist mir bei den Werbeapps (FreshPaint etc.) in 1607 aber unbekannt.
Aber über die Datei DefaultLayouts.xml im Defaults User Ordner kann ich das Startmenü auch anpassen. Daher würde ich diese gerne im Update im WSUS anpassen.
Ist mein Vorhaben mit dem WSUS möglich oder gibt es andere Methoden die Werbeapps zu entfernen nach einem Upgrade?

Content-Key: 321834

Url: https://administrator.de/contentid/321834

Printed on: April 23, 2024 at 15:04 o'clock

Member: User1000
User1000 Nov 23, 2016 updated at 11:53:22 (UTC)
Goto Top
Powershell-Skripts

Teil 1 funktioniert über GPO-Verteilung
Teil 2 funktioniert bei uns über Gruppenrichtlinien bislang noch nicht korrekt. face-sad

Quelle: Windows 10 Apps

function Pin-App {
    param(
        [parameter(mandatory=$true)][ValidateNotNullOrEmpty()][string[]]$appname,
        [switch]$unpin
    )
    $actionstring = @{$true='Von "Start" lösen|Unpin from Start';$false='An "Start" anheften|Pin to Start'}[$unpin.IsPresent]  
    $action = @{$true='unpinned from';$false='pinned to'}[$unpin.IsPresent]  
    $apps = (New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -in $appname}  
    
    if($apps){
        $notfound = compare $appname $apps.Name -PassThru
        if ($notfound){write-error "These App(s) were not found: $($notfound -join ",")"}  

        foreach ($app in $apps){
            $appaction = $app.Verbs() | ?{$_.Name.replace('&','') -match $actionstring}  
            if ($appaction){
                $appaction | %{$_.DoIt(); return "App '$($app.Name)' $action Start"}  
            }else{
                write-error "App '$($app.Name)' is already pinned to start or action not supported."  
            }
        }
    }else{
        write-error "App(s) not found: $($appname -join ",")"  
    }
}

$windows10apps= "Office holen" , "Begleiter für Telefon", "Kalender","Fotos", "Microsoft Edge", "Cortana", "Wetter", "Store", "Skype-Video", "Twitter", "OneNote", "Finanzen", "Karten", "Xbox" , "Nachrichten", "Mail", "Groove-Musik", "Filme & TV", "Candy Crush Soda Saga"  
Pin-App $windows10apps -unpin

Quelle: http://www.howtogeek.com/224798/how-to-uninstall-windows-10s-built-in-a ...
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *bingnews* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *bingweather* | Remove-AppxPackage
Get-AppxPackage *xboxapp* | Remove-AppxPackage
Member: djfflow
djfflow Nov 23, 2016 at 11:55:07 (UTC)
Goto Top
Hallo
genau dieses Powerhsell Skript meinte ich, aber damit werden z.B. FreshPaint, Flipbaord etc. nicht entfernt, da ich hier nicht den Namen kenne.
Member: DerWoWusste
DerWoWusste Nov 23, 2016 updated at 13:08:50 (UTC)
Goto Top
Hi.

Ich denke nicht, dass Du dem WSUS ein angepasstes Paket unterjubeln kannst, ohne Drittanbietertools.
Ich gebe auch zu bedenken, dass WSUS-Verteilung von OS-Upgrades brandgefährlich ist, siehe Admin werden dank des Windows 10 Upgrade-Setups
Member: SilvanUL
SilvanUL Dec 07, 2016 at 09:13:36 (UTC)
Goto Top
Hey,

bevor du das 1607 Funktionsupdate im WSUS genehmigst, musst du einige Anpassungen treffen, sonst funktioniert all das nicht.

Siehe dazu z.B: https://support.microsoft.com/en-us/kb/3194588

All AppDeInstall wäre dieses hier z.B. möglich:

if ($env:SYSTEMDRIVE -eq "X:")  
{
  $script:Offline = $true

  # Find Windows
  $drives = get-volume | ? {-not [String]::IsNullOrWhiteSpace($_.DriveLetter) } | ? {$_.DriveType -eq 'Fixed'} | ? {$_.DriveLetter -ne 'X'}  
  $drives | ? { Test-Path "$($_.DriveLetter):\Windows\System32"} | % { $script:OfflinePath = "$($_.DriveLetter):\" }  
  Write-Verbose "Eligible offline drive found: $script:OfflinePath"  
}
else
{
  Write-Verbose "Running in the full OS."  
  $script:Offline = $false
}


# ---------------------------------------------------------------------------
# Get-LogDir:  Return the location for logs and output files
# ---------------------------------------------------------------------------

function Get-LogDir
{
  try
  {
    $ts = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop
    if ($ts.Value("LogPath") -ne "")  
    {
      $logDir = $ts.Value("LogPath")  
    }
    else
    {
      $logDir = $ts.Value("_SMSTSLogPath")  
    }
  }
  catch
  {
    $logDir = $env:TEMP
  }
  return $logDir
}

# ---------------------------------------------------------------------------
# Get-AppList:  Return the list of apps to be removed
# ---------------------------------------------------------------------------

function Get-AppList
{
  begin
  {
    # Look for a config file.
    $configFile = "$PSScriptRoot\RemoveApps.xml"  
    if (Test-Path -Path $configFile)
    {
      # Read the list
      Write-Verbose "Reading list of apps from $configFile"  
      $list = Get-Content $configFile
    }
    else
    {
      # No list? Build one with all apps.
      Write-Verbose "Building list of provisioned apps"  
      $list = @()
      if ($script:Offline)
      {
        Get-AppxProvisionedPackage -Path $script:OfflinePath | % { $list += $_.DisplayName }
      }
      else
      {
        Get-AppxProvisionedPackage -Online | % { $list += $_.DisplayName }
      }

      # Write the list to the log path
      $logDir = Get-LogDir
      $configFile = "$logDir\RemoveApps.xml"  
      $list | Set-Content $configFile
      Write-Information "Wrote list of apps to $logDir\RemoveApps.xml, edit and place in the same folder as the script to use that list for future script executions"  
    }

    Write-Information "Apps selected for removal: $list.Count"  
  }

  process
  {
    $list
  }

}

# ---------------------------------------------------------------------------
# Remove-App:  Remove the specified app (online or offline)
# ---------------------------------------------------------------------------

function Remove-App
{
  [CmdletBinding()]
  param (
        [parameter(Mandatory=$true,ValueFromPipeline=$true)]
        [string] $appName
  )

  begin
  {
    # Determine offline or online
    if ($script:Offline)
    {
      $script:Provisioned = Get-AppxProvisionedPackage -Path $script:OfflinePath
    }
    else
    {
      $script:Provisioned = Get-AppxProvisionedPackage -Online
      $script:AppxPackages = Get-AppxPackage
    }
  }

  process
  {
    $app = $_

    # Remove the provisioned package
    Write-Information "Removing provisioned package $_"  
    $current = $script:Provisioned | ? { $_.DisplayName -eq $app }
    if ($current)
    {
      if ($script:Offline)
      {
        $a = Remove-AppxProvisionedPackage -Path $script:OfflinePath -PackageName $current.PackageName
      }
      else
      {
        $a = Remove-AppxProvisionedPackage -Online -PackageName $current.PackageName
      }
    }
    else
    {
      Write-Warning "Unable to find provisioned package $_"  
    }

    # If online, remove installed apps too
    if (-not $script:Offline)
    {
      Write-Information "Removing installed package $_"  
      $current = $script:AppxPackages | ? {$_.Name -eq $app }
      if ($current)
      {
        $current | Remove-AppxPackage
      }
      else
      {
        Write-Warning "Unable to find installed app $_"  
      }
    }

  }
}


# ---------------------------------------------------------------------------
# Main logic
# ---------------------------------------------------------------------------

$logDir = Get-LogDir
Start-Transcript "$logDir\RemoveApps.log"  

Get-AppList | Remove-App

Stop-Transcript

Möchtest du nur gewisse Apps deinstallieren, einfach eine XML-Datei in den gleichen Ordner legen und die Apps angeben. Das PS-Skript sucht autoamtisch nach einer XML vor der Installation.

Gruß,
Silvan
--
"Es muss nicht neu sein. Nur treu sein."
Uli Ludwig Online
Member: djfflow
djfflow Dec 07, 2016 at 12:05:45 (UTC)
Goto Top
Hallo Silvan,

danke für dein Script, aber eine kleine Erklärung (Wie anzuwenden? Was tut es?) dazu wäre auch ganz nett.
Member: SilvanUL
SilvanUL Dec 07, 2016 updated at 18:37:21 (UTC)
Goto Top
Hey djfflow,

das Script löscht sämtliche Windows-Apps. Einfach als ps1 abspeichern und starten.

Wenn du nun z.B. nur 3DBuilder oder BingFinance von deinem System löschen möchtest, erstellt du eine XML-Datei (benne diese RemoveApps.xml) wo du untereinander z.B:

Microsoft.3DBuilder
Microsoft.BingFinance
Microsoft.BingNews
Microsoft.BingSports

auflistet. Wenn das Script und die XML-Datei nun im selben Ordner sind, werden nur die aufgelisteten Apps aus der XML gelöscht. Das Scipt kommt übrigens von Michael Niehaus face-smile

Gruß,
Silvan
--
"Es muss nicht neu sein. Es muss nur treu sein."
Uli Ludwig Online