Skip to main content

Using PowerShell to Remotely Check the Windows FileWave Client Status

What

The Windows FileWave Client runs as a Windows service, so uptime, local changes, crashes, or service problems can affect whether it is available. This article provides a PowerShell example for checking a list of Windows devices for FileWave Client service status, client version, and assigned server address.

When/Why

You probably will not run this every day, but it is useful when you need to sweep a Windows network and find devices where the FileWave Client may be missing, stopped, unreachable, or pointed at the wrong server. The example uses legacy paths and changes a Windows service. Read the limits below before deciding whether to use it.

How

For a current Windows Client, use FileWave Client Status Check on the device to inspect its status and worklist. The remote example below uses the older Program Files (x86) executable path and a fixed registry location. An unreadable version or server address does not establish that the Client is missing.

This is not a read-only check. The example attempts to set Remote Registry to Manual and start it, then set it to Disabled and stop it. It does not restore the previous startup type or running state, and a failed registry read can skip the shutdown step. Do not run it unchanged on devices where the existing service configuration must be preserved.

The example uses Windows PowerShell 5.1. PowerShell 7 does not support the ComputerName parameter on Get-Service. A service lookup error goes to the same output branch as a missing service; verify locally before deciding to reinstall.

#import a list of computers
$mypath=$MyInvocation.MyCommand.Path
$mypath=Split-Path $mypath -Parent
try {
    $computers=Get-Content $mypath\computers.txt -ErrorAction Stop
} catch {
    #no computers.txt file found
    write-host "`nTo use this utility, a text file called computers.txt must exist in the same location as the script.  The file should contain one computer name or IP per line"
    break
}

foreach ($computer in $computers) {
    $online=$false
    try{
        #try to resolve the name
        $online = Resolve-DnsName $computer -quicktimeout -ErrorAction Stop
        $online = $true
    }catch{
        #Catching errors...machine offline
        $online= $false
    }

    if (!$online) {
        #device not online...show it in UI so that we see progress, but don't write it to the results file since it isn't actionable
        write-host "$computer, Not online"
    } else {
        #device online, so let's just see if the service is there
        $fw_service=""
        try{
            #Getting service ...sometimes device might not allow collection (if RPC is unavailable for instance)
            $fw_service = Get-Service -ComputerName $computer  -Name 'FilewaveWinClient' -ErrorAction Stop
            $fw_service=$fw_service.Status
        }catch{
            #Catching errors...no filewave service
            $fw_service="no"
        }

        if ($fw_service -eq "no") {
            #no need to look further since we either can't talk to RPC, or there is no FW service
            write-host "$computer, No FW Service or RPC unavailable" 
            Add-Content -Path $mypath\output.txt -Value "$computer, FW Needs Installed or RPC Unavailable"

        } else {
            #fw is there as a service, so let's return status, version, and server address            
            try {
                #using C$ share, which won't require winrm
                $TargetPath = "\\$computer\C$\Program Files (x86)\FileWave\fwcld.exe"
                $fw_version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($TargetPath)
                $fw_version = $fw_version.ProductVersion       
            } catch {
                #Catching errors
                $fw_version="version not readable"
            }

            #get fw server address from registry
            try {
                #read server address from registry
                #we need remote registry turned on to read, but we'll turn it back off
                #note this does not account for an environment where remote-registry is on by default...if so, comment out the remote registry lines
                Get-Service -ComputerName $computer -Name RemoteRegistry | Set-Service -StartupType Manual -PassThru| Start-Service

                $Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
                $RegKey= $Reg.OpenSubKey("SOFTWARE\\WOW6432Node\\FileWave\\WinClient")
                $fw_server = $RegKey.GetValue("Server")

                #turn remote registry back off
                Get-Service -ComputerName $computer -Name RemoteRegistry | Set-Service -StartupType Disabled -PassThru| Stop-Service
                
            } catch {
                #Catching errors...no registry
                $fw_server="server address not readable"
            }

            #write the output
            write-host "$computer, $fw_service, $fw_version, $fw_server"
            Add-Content -Path $mypath\output.txt -Value "$computer, $fw_service, $fw_version, $fw_server"
            
        }
    }
}

Assumptions made in the above code:
1. A text file named computers.txt exists in the same folder as the PowerShell script.
2. computers.txt contains one computer name or IP address per line. Names are better when DNS is dynamic.
3. The account needs authorized access to the remote services, registry and administrative share used by the example. A failed access check is not an installation result.
4. This example does not use WinRM.

You can adapt this script to check other services, use a different authentication method, or add remediation. As written, it reports the device name, FileWave service status, FileWave Client version, and assigned FileWave Server address. For corrective action, use your approved remote-management tool; PsExec is one common option in Windows environments.

Digging Deeper

The shorter example prints names from online_test.txt that DNS can resolve. A DNS response is not a connection to the device or its FileWave service. In the main example, a failed DNS lookup appears on the console as “Not online” and is omitted from output.txt. That file is appended to across runs, so do not treat it as a complete list of current results.

#Let's just look for a list of devices online

#import a list of computers
$mypath=$MyInvocation.MyCommand.Path
$mypath=Split-Path $mypath -Parent
$computers=Get-Content $mypath\online_test.txt

foreach ($computer in $computers) {
    $online=$false
    try{
        #try to resolve 
        $online = Resolve-DnsName $computer -quicktimeout -ErrorAction Stop
        $online = $true
        write-host $computer
    }catch{
        #Catching errors...machine offline
        $online= $false
    }
}