Configuration Manager 2012 Compliance Baseline to Disable VLC Media Player Automatic Updates

Posted: August 7, 2014 in System Center Configuration Manager 2012
Tags: , ,

In this post I’m not going to explain how to create a Compliance Item and Baseline for that you can review this post; Configuration Manager 2012 Compliance Baseline to Disable Adobe Air Automatic Updates.

Below you will find scripts for Discovery and Remediation of VLC Media Player automatic updates.

This script evaluates the vlcrc file located in the users profile, so when you creat the setting for this CI you must select “Run scripts by using the logged on user credentials” as shown in this post; Configuration Manager 2012 Compliance Baseline to Disable Adobe Shockwave Player Automatic Updates

This script also removes the Privacy and Network Access question that pops up the first time a user starts VLC Media Player.1

<#
  This script will check if automatic updates is disabled and return a Compliant/Non-Compliant string.

  Created:     04.08.2014
  Version:     1.0
  Author:      Odd-Magne Kristoffersen
  Homepage:    https://sccmguru.wordpress.com/
    
  References:
  - Disable automatically check for updates
    http://wiki.robotz.com/index.php/VideoLAN_Player
#>

$UpdateCheck1 = Select-String C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc -pattern "qt-updates-notif" | Select-Object Line
$UpdateCheck2 = Select-String C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc -pattern "qt-privacy-ask" | Select-Object Line
$UpdateCheck3 = Select-String C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc -pattern "qt-updates-days" | Select-Object Line

if(($UpdateCheck1.Line -eq 'qt-updates-notif=0') -and ($UpdateCheck2.Line -eq 'qt-privacy-ask=0') -and ($UpdateCheck3.Line -eq 'qt-updates-days=0'))
    {Write-Host 'Compliant'}
    else 
    {Write-Host 'Non-Compliant'}
<#
  This script will disable automatic updates if it is enabled.

  Created:     04.08.2014
  Version:     1.0
  Author:      Odd-Magne Kristoffersen
  Homepage:    https://sccmguru.wordpress.com/
    
  References:
  - Disable automatically check for updates
    http://wiki.robotz.com/index.php/VideoLAN_Player
#>

$UpdateCheck1 = Select-String C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc -pattern "qt-updates-notif"
$UpdateCheck11 = $UpdateCheck1.Line
(Get-Content C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc) -replace "$UpdateCheck11", 'qt-updates-notif=0' | Set-Content C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc
$UpdateCheck2 = Select-String C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc -pattern "qt-privacy-ask"
$UpdateCheck22 = $UpdateCheck2.Line
(Get-Content C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc) -replace "$UpdateCheck22", 'qt-privacy-ask=0' | Set-Content C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc
$UpdateCheck3 = Select-String C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc -pattern "qt-updates-days"
$UpdateCheck33 = $UpdateCheck3.Line
(Get-Content C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc) -replace "$UpdateCheck33", 'qt-updates-days=0' | Set-Content C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc

You can also download the scripts here: Compliance Settings Scripts

Advertisements
Comments
  1. Mieszko says:

    Hi,

    I see you’ve hardcoded “Users” directory to C:\Users, but what’s even worse – if the file C:\Users\$env:USERNAME\AppData\Roaming\vlc\vlcrc does not exist script fails.

    First, I’ve replaced ‘C:\Users\$env:USERNAME\AppData\Roaming’ with more convenient ‘$env:APPDATA’.
    Additionally, I’ve added check (if the preference file exists) – and assumed compliance if it doesn’t.

    If(Test-Path $env:APPDATA\vlc\vlcrc)
    {
    $UpdateCheck1 = Select-String $env:APPDATA\vlc\vlcrc -pattern “qt-updates-notif” | Select-Object Line
    $UpdateCheck2 = Select-String $env:APPDATA\vlc\vlcrc -pattern “qt-privacy-ask” | Select-Object Line
    $UpdateCheck3 = Select-String $env:APPDATA\vlc\vlcrc -pattern “qt-updates-days” | Select-Object Line

    if(($UpdateCheck1.Line -eq ‘qt-updates-notif=0’) -and ($UpdateCheck2.Line -eq ‘qt-privacy-ask=0’) -and ($UpdateCheck3.Line -eq ‘qt-updates-days=0’))
    {Write-Host ‘Compliant’}
    else
    {Write-Host ‘Non-Compliant’}
    }
    else
    {Write-Host ‘Compliant’}

  2. spitfire says:

    I’ve added same fixes to the Remediation Script:

    If(Test-Path $env:APPDATA\vlc\vlcrc)
    {
    $UpdateCheck1 = Select-String $env:APPDATA\vlc\vlcrc -pattern “qt-updates-notif”
    $UpdateCheck11 = $UpdateCheck1.Line
    (Get-Content $env:APPDATA\vlc\vlcrc) -replace “$UpdateCheck11”, ‘qt-updates-notif=0’ | Set-Content $env:APPDATA\vlc\vlcrc
    $UpdateCheck2 = Select-String $env:APPDATA\vlc\vlcrc -pattern “qt-privacy-ask”
    $UpdateCheck22 = $UpdateCheck2.Line
    (Get-Content $env:APPDATA\vlc\vlcrc) -replace “$UpdateCheck22”, ‘qt-privacy-ask=0’ | Set-Content $env:APPDATA\vlc\vlcrc
    $UpdateCheck3 = Select-String $env:APPDATA\vlc\vlcrc -pattern “qt-updates-days”
    $UpdateCheck33 = $UpdateCheck3.Line
    (Get-Content $env:APPDATA\vlc\vlcrc) -replace “$UpdateCheck33”, ‘qt-updates-days=0’ | Set-Content $env:APPDATA\vlc\vlcrc
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s