FolderRisk: Caution
ras C:\Windows\System32\ras
C:\Windows\System32\ras: Remote Access Service (RAS/RRAS) components. VPN connections live in the .pbk phone books under ProgramData and AppData.
What it’s for
System32\ras is part of the system components of RAS (Remote Access Service, built into RRAS), which manages remote access connections: VPN, modem, incoming connections. It is not specific to servers, since Windows clients use it for their VPN connections too. This is not where to look for your connections.
What it contains
RAS service components, which vary with the installed roles. The connections themselves are described in rasphone.pbk phone books:
%APPDATA%\Microsoft\Network\Connections\Pbkfor the user.%ProgramData%\Microsoft\Network\Connections\Pbkfor all users, with a_hiddenPbksubfolder for connections created by applications.
A phone-book entry holds phone numbers or the server address, bit rates, authentication information and other connection parameters.
Risks and best practices
.pbkfiles describe remote access, so treat them as sensitive data and do not share them.- Create, edit and export a connection from Settings > Network & internet > VPN or with the VPN cmdlets, not by copying files.
- On an RRAS server, keep write access to this folder to administrators.
- To troubleshoot a RAS connection, turn tracing on with
netsh ras set tracing * enabled: the files are written toC:\Windows\tracing.
Useful commands
# VPN connections of the user and of all usersGet-VpnConnectionGet-VpnConnection -AllUserConnection
# Active remote access connectionsrasdial
# All-users phone bookGet-Content "$env:ProgramData\Microsoft\Network\Connections\Pbk\rasphone.pbk" -ErrorAction SilentlyContinue