Applies to: Windows Server 2019, Windows Server 2022 and Windows Server 2025, subject to the workload and edition requirements below.
What the File Server role actually installs
The File Server role makes Windows Server available as a managed file-serving platform. Its core responsibility is exposing folders through SMB so that authorized users and applications can work with files over the network. Installing the role is the starting point: it does not choose a data location, create business shares, assign department permissions or establish a recovery policy. This guide separates a successful feature installation from a file service that is ready for users.
Use this procedure for a standalone or domain-member server. A clustered file server, Scale-Out File Server or Storage Spaces Direct deployment needs its own architecture and validation. A domain controller already performs important SMB functions, but that is not a reason to turn it into a general departmental file server. Keep business data and its operational risk on a dedicated member server when the design allows it.
Prepare storage, identity and access before installation
Sign in with an account allowed to administer the target server and open Windows PowerShell as administrator. The ServerManager module used here belongs to Windows Server; running the same command on an ordinary Windows client is not an equivalent deployment. Windows PowerShell 5.1 provides a predictable environment for these built-in administration modules. In a remote session, confirm the computer name before changing features.
Choose a data volume with enough capacity for growth, shadow copies if used, and backup staging where applicable. Do not assume that the drive letter D: identifies the same disk on every server. Check its label, file system and free space. NTFS is needed if the design will use FSRM. Decide which AD groups will receive read and modify access, which networks may reach SMB, and who owns restoration decisions.
hostname
Get-Volume | Select-Object DriveLetter,FileSystemLabel,FileSystem,HealthStatus,SizeRemaining,Size
Get-WindowsFeature FS-FileServer
Install the minimum required feature
Inspect the feature result first. An Installed state means the role is already present; do not uninstall and reinstall it merely to make the command appear productive. An Available state means Windows has the installation payload or can retrieve it from an approved feature source. A Removed state may require a matching Windows installation source. Keep the source aligned with the server release and servicing level.
$result = Install-WindowsFeature -Name FS-FileServer -IncludeManagementTools
$result | Format-List Success,RestartNeeded,ExitCode,FeatureResultThe management-tools switch requests relevant administration components alongside the role. It does not install every optional storage feature. Add DFS, FSRM, deduplication or iSCSI only when there is an actual requirement. Review Success and RestartNeeded rather than treating a returned object as proof of completion. If a restart is required, schedule it with the owners of other services on this computer and verify the feature again afterwards.
Check SMB service and network boundaries
The Server service, whose service name is LanmanServer, handles SMB server functionality. Check that it is running and investigate an unexpected stopped state before changing startup behaviour. Review the active firewall profile and applicable policy. A domain-joined server with a Public profile may have DNS, domain-location or network configuration problems; changing the profile or opening every firewall rule can conceal the underlying issue.
Get-Service -Name LanmanServer
Get-NetConnectionProfile
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol,EnableSMB2Protocol,RequireSecuritySignature
Get-SmbShare | Select-Object Name,Path,DescriptionPermit TCP 445 only from approved client or application networks through the relevant firewall controls. Do not expose ordinary SMB directly to the public Internet. Use an authorized private network or another deliberately designed access method. Preserve SMB signing and modern authentication requirements. Windows Server 2025 hardening can reveal incompatible clients that appeared to work against an older file server; resolve the client issue rather than applying a broad security downgrade.
Create the data hierarchy without accidentally publishing it
The following example creates only a folder. Replace its path after validating the intended volume. A new directory is not automatically an SMB share, and that distinction is useful: it lets you finish permissions and backup configuration before users can connect. On an existing path, inspect its current contents and ACL before deciding whether it is appropriate.
$path = 'D:\Shares\Departments'
if (-not (Test-Path -LiteralPath $path)) {
New-Item -ItemType Directory -Path $path | Out-Null
}
Get-Acl -LiteralPath $path | Format-List Owner,AccessToStringCreate a clear inheritance boundary for departmental permissions. Retain SYSTEM and an authorized administration group so that operational maintenance remains possible. Do not copy an ACL from an unrelated application directory or grant broad write access just to finish setup. Share creation and effective-access testing are separate steps covered in the secure SMB share guide. An administrative drive share is not a substitute for a controlled business share.
Verify readiness from both server and client
A useful acceptance check covers installation, storage and a real user workflow. On the server, confirm FS-FileServer is Installed, LanmanServer is Running, and the selected volume is healthy. From an authorized client, check DNS and transport to the server FQDN. A successful port test proves reachability, not permission to read or write data.
Get-WindowsFeature -Name FS-FileServer
Get-Service -Name LanmanServer
# Run this transport check from an approved client:
Test-NetConnection -ComputerName fs01.corp.example -Port 445When the first share is created, test using ordinary representative accounts rather than only the administrator. A read-only user should open a document but fail an attempted modification; a modify user should perform the agreed workflow; an unrelated user should be denied. Also restore a sample file from the chosen backup path. These tests establish the service behaviour users actually depend on, which an installed-feature result cannot demonstrate.
Diagnose installation and first-connection failures
If installation reports a source error, review the Server Manager, DISM and servicing evidence instead of repeatedly running the same command. A payload source must match the server version. If the service cannot start, inspect System events and dependencies, record the error text, and check whether a security baseline or endpoint product changed service configuration. Avoid deleting service registry keys as a general repair.
If a client reaches TCP 445 but cannot open the eventual share, check the exact UNC path, name resolution, account identity, group membership and both share and file-system permissions. Existing SMB sessions can retain old credentials. Test with a clean sign-in or a separate test client rather than assuming a group change is instantly reflected everywhere. If TCP 445 fails, trace network policy, routing and Windows Firewall before editing the share ACL. Access and transport failures require different evidence.
Recovery and operational handover
If installation fails before any shares are published, preserve the feature result and servicing logs, correct the prerequisite and retry. If a new installation must be removed, first confirm that no business shares, applications or dependent services use it. Export the current share list and permissions, migrate clients and data, and arrange a maintenance window before uninstalling FS-FileServer. Removing the role is not a data-restoration strategy.
Record the server name, storage mapping, share owner, access groups, backup schedule and retention, restore procedure and monitoring thresholds in the handover. Monitor capacity and failed backups before they become outages. Include periodic access review and a documented way to remove departed users through group membership. The role is ready for production when an authorized user can complete the intended file workflow and an operator can recover it, not merely when the installation wizard closes.
Related guidance and official references
Create a secure SMB share; Plan FSRM quotas; Create a full server backup.