Configuration Manager 2012 Compliance Baseline to Disable FileZilla FTP Client Automatic Updates

Posted: August 11, 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 FileZilla FTP Client automatic updates.

<#
  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:
  - Fzdefaults.xml
    https://wiki.filezilla-project.org/Fzdefaults.xml
#>

$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture

If($OSArchitecture.OSArchitecture -ne "32-bit")
    {
    $XMLExists = Test-Path -Path "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml"
        If($XMLExists -eq 'True') {$UpdateCheck = Select-String "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" -pattern "Disable update check" | Select-Object Line}
                                               If($UpdateCheck.Line -eq '<Setting name="Disable update check">1</Setting>') {Write-Host 'Compliant'} else {Write-Host 'Non-Compliant'}
    } 
    else
    {
        $XMLExists = Test-Path -Path "C:\Program Files\FileZilla FTP Client\fzdefaults.xml"
        If($XMLExists -eq 'True') {$UpdateCheck = Select-String "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" -pattern "Disable update check" | Select-Object Line}
                                               If($UpdateCheck.Line -eq '<Setting name="Disable update check">1</Setting>') {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:
  - Fzdefaults.xml
    https://wiki.filezilla-project.org/Fzdefaults.xml
#>

$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture

If($OSArchitecture.OSArchitecture -ne "32-bit")
{
    $XMLExists = Test-Path -Path "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml"
        If($XMLExists -eq $False)
                {
                New-Item "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" -ItemType File
                Add-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'
                Add-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" '<FileZilla3>'
                Add-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" '<Settings>'
                Add-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" '<Setting name="Disable update check">1</Setting>'
                Add-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" '<Setting name="Greeting version" type="string">4.0.0.0</Setting>'
                Add-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" '</Settings>'
                Add-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" '</FileZilla3>'
                }
        If($XMLExists -eq $True)
                {
                $UpdateCheck1 = Select-String "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml" -pattern "Disable update check"
                $UpdateCheck11 = $UpdateCheck1.Line
                (Get-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml") -replace "$UpdateCheck11",'<Setting name="Disable update check">1</Setting>' | Set-Content "C:\Program Files (x86)\FileZilla FTP Client\fzdefaults.xml"
                }
    
}
else
{
    $XMLExists = Test-Path -Path "C:\Program Files\FileZilla FTP Client\fzdefaults.xml"
        If($XMLExists -eq $False)
                {
                New-Item "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" -ItemType File
                Add-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'
                Add-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" '<FileZilla3>'
                Add-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" '<Settings>'
                Add-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" '<Setting name="Disable update check">1</Setting>'
                Add-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" '<Setting name="Greeting version" type="string">4.0.0.0</Setting>'
                Add-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" '</Settings>'
                Add-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" '</FileZilla3>'
                }
        If($XMLExists -eq $True)
                {
                $UpdateCheck1 = Select-String "C:\Program Files\FileZilla FTP Client\fzdefaults.xml" -pattern "Disable update check"
                $UpdateCheck11 = $UpdateCheck1.Line
                (Get-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml") -replace "$UpdateCheck11",'<Setting name="Disable update check">1</Setting>' | Set-Content "C:\Program Files\FileZilla FTP Client\fzdefaults.xml"
                }
    
}

You can also download the scripts here: Compliance Settings Scripts

Advertisements

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