Ransomware still finds its way into businesses through phishing, stolen VPN credentials and unpatched edge devices, and when it lands on a PC with mapped drives, the file server is usually what gets hurt most. File Server Resource Manager (FSRM) is a free role built into Windows Server that can spot the early signs of mass encryption on a share and alert you, or even cut off the offending user, within seconds. This guide shows how to set up an FSRM “canary” folder on Windows Server 2016, 2019, 2022 and 2025, how to add a blocklist of known ransomware extensions, and where FSRM fits alongside your other defences.
One thing to be clear about up front: FSRM does not stop ransomware from running. It detects suspicious file activity on the server and reacts. Used well it can limit the damage to a handful of folders instead of a whole share, but it is a tripwire, not a replacement for patching, endpoint protection and tested backups.
How the Canary Folder Approach Works
Most ransomware works through folders in order, creating encrypted copies of files (often with a new extension) and dropping a ransom note in each folder. If you place a folder at the very top of each share, named so it sorts first, the malware is likely to hit it before anything important. You then tell FSRM to react to any new or renamed file in that folder, apart from the one decoy file you put there yourself. Nobody has a legitimate reason to write to it, so any hit is worth investigating straight away.
FSRM file screens react when a file is created or renamed in a screened folder. Ransomware that overwrites files in place without changing their names will not trip a file screen, which is why the canary is one layer and not the whole plan.
Step 1: Install the FSRM Role
Open PowerShell as administrator on the file server and run:
Install-WindowsFeature -Name FS-Resource-Manager -IncludeManagementTools
No reboot is normally needed. You can also add it through Server Manager > Add Roles and Features > File and Storage Services > File and iSCSI Services > File Server Resource Manager. Once installed, open File Server Resource Manager from the Tools menu in Server Manager or by running fsrm.msc.
Step 2: Configure Email Notifications
In the FSRM console, right-click File Server Resource Manager (Local) at the top of the tree and choose Configure Options. On the Email Notifications tab, enter your SMTP server, the default administrator recipient and the from address, then click Send Test Email. FSRM sends plain SMTP without authentication, so point it at an internal relay or a connector your mail system allows from the server’s IP address.
The same thing in PowerShell:
Set-FsrmSetting -SmtpServer "smtp-relay.yourdomain.local" -AdminEmailAddress "[email protected]" -FromEmailAddress "[email protected]"
Send-FsrmTestEmail -ToEmailAddress "[email protected]"
Step 3: Create the Canary File Group
Expand File Screening Management, select File Groups and click Create File Group. Call it something like Canary - All Files, add * under Files to include and add do_not_modify_or_delete.txt under Files to exclude.
New-FsrmFileGroup -Name "Canary - All Files" -IncludePattern @("*") -ExcludePattern @("do_not_modify_or_delete.txt")
Step 4: Create the File Screen Template
Select File Screen Templates and click Create File Screen Template. Name it Canary Alert, choose Passive screening (so the write is allowed and logged rather than blocked, which keeps the evidence) and tick the Canary – All Files group. Then set the actions:
- Email Message: tick Send e-mail to the following administrators. A useful subject is
[Source Io Owner] wrote [Source File Path] on [Server], which tells you straight away which account to look at. - Event Log: tick Send warning to event log. File screen hits are logged in the Application log by the SRMSVC source (event ID 8215), which is handy if you forward events to a SIEM.
- Command (optional, see below): run a script that blocks the user.
Step 5: Prepare the Canary Folder
At the root of each share you want to protect, create a folder that will sort first, for example _ do not delete or !_canary, and inside it create a text file called do_not_modify_or_delete.txt. Add a few dummy documents too (a .docx, an .xlsx, a .pdf) so the folder looks worth encrypting. Make sure users have modify rights there, the same as the rest of the share, otherwise the malware will simply skip it. It is worth telling staff what the folder is so nobody “tidies it up”.
Step 6: Apply the File Screen
Select File Screens, click Create File Screen, browse to the canary folder and choose Derive properties from this file screen template with Canary Alert selected. Click Create. Repeat for each share, or script it:
New-FsrmFileScreen -Path "D:\Shares\Finance\_ do not delete" -Template "Canary Alert"
Test it by creating a new file in the canary folder from a client PC. You should get an email and a warning in the event log within a few seconds.
Optional: Block the User Automatically
An email at 3am is not much use if nobody reads it until 9. A Command action can deny the offending account access to every share on the server the moment the canary trips. Save this as C:\Scripts\Block-RansomUser.ps1:
param([string]$User)
Get-SmbShare -Special $false | ForEach-Object {
Block-SmbShareAccess -Name $_.Name -AccountName $User -Force
}
In the template’s Command tab, set the command to C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe, the arguments to -NoProfile -ExecutionPolicy Bypass -File C:\Scripts\Block-RansomUser.ps1 -User "[Source Io Owner]" and run it as Local System. Lock down the script folder so only administrators can edit it, because anything in it runs as SYSTEM. Once you have cleaned the user’s PC, reverse the block with Unblock-SmbShareAccess.
Add a Known Ransomware Extension Screen
As a second layer, create a file group of extensions and ransom note names commonly used by ransomware (for example *.locky, *.crypt, *_readme.txt, *decrypt*instructions*) and apply an Active screening template to the whole share so those files are blocked outright. Community-maintained lists exist on GitHub that you can pull in with a scheduled script. Keep the list sensible and test it against a copy of your data first, because an over-broad pattern will block legitimate files and generate a lot of noise. Modern ransomware often uses random extensions, so treat this as a bonus rather than your main detection.
Where FSRM Fits in 2026
- Backups first. Keep at least one copy offline or immutable and test restores (see Windows Server Backup to a network share for a simple starting point). FSRM limits damage; backups recover from it.
- Endpoint protection. Microsoft Defender’s ransomware protection features and attack surface reduction rules stop a lot of this on the PC before it reaches the share.
- Permissions. Users who can only write to the folders they need cannot encrypt the rest. Least privilege on shares is one of the most effective controls you have, and our guide to NTFS and share permissions covers how to set it up properly.
- Volume Shadow Copies. Previous Versions on the data volume make small incidents quick to roll back, although many strains try to delete them.
FAQ
Does FSRM work on Windows Server 2025?
Yes. FSRM is still included in Windows Server 2025 and the console, PowerShell module and file screen features work the same way as on 2016, 2019 and 2022.
Will this slow my file server down?
Not noticeably. File screening is handled by a lightweight filter driver and a single canary screen per share adds almost no overhead.
Can I use FSRM on a NAS or Azure Files?
No. FSRM only works on local volumes attached to a Windows Server. For a NAS, check whether the vendor offers its own ransomware detection or snapshot features.
Gear We Recommend
Firewall rules are only half the story. Here’s the networking hardware we recommend for a properly segmented setup.
Browse our Networking Equipment picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.
I’m probably missing something obvious, but what purpose does excluding the text file in the folder serve? Wouldn’t you want to know if it gets changed?
I’m probably missing something obvious, but what purpose does excluding the text file in the folder serve? Wouldn’t you want to know if it gets changed?
I’m probably missing something obvious, but what purpose does excluding the text file in the folder serve? Wouldn’t you want to know if it gets changed?