Using PowerShell to Remotely Check the Windows FileWave Client Status
What
The Windows FileWave Client onruns as a Windows isservice, likeso anyuptime, otherlocal softwarechanges, service...thecrashes, or service problems can beaffect impactedwhether byit computeris uptime, user interference, crashes, etc. available. This article gives youprovides a wayPowerShell toexample INDEPENDENTLYfor check thatchecking a list of Windows devices has thefor FileWave Client,Client service status, client version, and itassigned isserver in working order (or not).address.
When/Why
WillYou probably will not run this every day, but it is useful when you need thisto frequently? Unlikely, but all the same, it issweep a great tool for sweeping aWindows network toand look forfind devices and confirmwhere the FileWave clientClient (formay Windowsbe only).missing, stopped, Theunreachable, codeor herepointed doesat makethe somewrong server. Review the assumptions aboutbelow yourbefore environment,using but those are called out below.it.
How
So,Use the script below when you thinkneed thea FileWaveremote clientfirst maypass bebefore brokenvisiting devices or missingopening onindividual someremote endpoints? Wouldn't it be great if you could verify that remotely rather than having to confirm the devices by hand. The following allows you to do just that.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. There is aA text file callednamed computers.txt exists in the same locationfolder as the PowershellPowerShell scriptscript.
2. That computers.txt file contains aone computer name or IP address per lineline. (nameNames are better when DNS is better if you have dynamic DNS)dynamic.
3. The ThatPowerShell thesession Powershellruns itselfwith isdomain runningadministrator fromrights aor Domainequivalent Adminremote-service account...thisand avoidsadmin-share any credential related issuesaccess.
4. It is assumed that WinRM is not enabledenabled. If WinRM is available in your environmentenvironment, (ifyou itmay isprefer a remoting-based version of this code could easily be made more elegant)check.
NoteYou thatcan adapt this script could easily be modified to look atcheck other services, touse authenticatea differently,different andauthentication tomethod, takeor add remediation. As provided,written, it simplyreports provides a list of results ofthe device name, FWFileWave service status, FWFileWave clientClient version, and FWassigned serverFileWave addressServer assigned.address. For Allcorrective veryaction, usefuluse informationyour forapproved troubleshooting.remote-management tool; PSEXECPsExec is highlyone recommendedcommon foroption takingin correctiveWindows action.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 a resource to pre-sweepcheck the device list forwhich devices that are online separately,before yourunning canthe main script, use thethis following.shorter example. A refinedfiltered list will just makemakes the aboveservice-status scriptcheck run a bit 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
}
}