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. Review the assumptions below before using it.
How
Use the script below when you need a remote first pass before visiting devices or opening individual remote sessions.
#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 PowerShell session runs with domain administrator rights or equivalent remote-service and admin-share access.
4. WinRM is not enabled. If WinRM is available in your environment, you may prefer a remoting-based version of this check.
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.
Related Content
- Script Best Practices
- Using PsExec to Remotely Restart the FileWaveWinClient Service
- FileWave Client Status Check: How to ask the client what it is doing on macOS and Windows
Digging Deeper
If you want to pre-check which devices are online before running the main script, use this shorter example. A filtered list makes the service-status check run faster.
#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
}
}
No comments to display
No comments to display