This section will help you manage user sessions and open files.
You use the Windows-native Shared Folders GUI tool and the Amazon FSx CLI for remote management on PowerShell to manage user sessions and open files on your Amazon FSx for Windows File Server file system.
Note
It will take approximately 15 minutes to complete this section.
Important
Read through all steps below and watch the quick video before continuing.
From the Amazon FSx console, click the link to the STG326 - SAZ file system and select the Network & security tab. Copy the DNS Name of the file system to the clipboard.
Go to the remote desktop session for your Windows Instance 0.
Click Start.
Type fsmgmt.msc.
From the Shared Folders Console, select Action >> Connect to another computer….
Paste the DNS Name copied above in the Another computer: text box and click Ok.
From the left pane select Sessions.
Review the open sessions to the file system.
From the left pane select Open Files.
Review the open files of the file system.
Keep the Shared Folders Console open.
Click Start >> Windows PowerShell.
Important
This section assumes that STG326 - SAZ is mapped as the Z:/ drive. If your Windows Instance 0 does not have a mapped Z:/ drive, map STG326 - SAZ as the Z:/ drive (see the previous section for step-by-step instructions).
Run the DiskSpeed script below to test read performance of the mapped Z: drive.
$random = $(Get-Random)
fsutil file createnew Z:\${env:computername}-$random.dat 100000000000
C:\Tools\DiskSpd-2.0.21a\amd64\DiskSpd.exe -d120 -w0 -r -t1 -o32 -b64K -Su -L Z:\${env:computername}-$random.dat
While the script is running, go back to the Shared Folders Console and refresh the Open Files view.
Do you see an open file?
Tip
Check your email. You should eventually get a High Throughput Alarm email.
Context-click (right-click) the new open file (e.g. D:\share\EC2AMAZ-xxxxxx-xxxxx.dat) and select Close Open File. Select Yes at the prompt window.
What happened to the open file?
What happened to the DiskSpd command in the PowerShell window?
Close the PowerShell window. Run exit.
Close the Shared Folders Console.
Important
Read through all steps below and watch the quick video before continuing.
Copy the script below into your favorite text editor.
$WindowsRemotePowerShellEndpoint = "windows_remote_powershell_endpoint" # e.g. "fs-0123456789abcdef.example.com"
enter-pssession -ComputerName ${WindowsRemotePowerShellEndpoint} -ConfigurationName FsxRemoteAdmin
From the Amazon FSx console, click the link to the STG326 - SAZ file system and select the Network & security tab. Copy the Windows Remote PowerShell Endpoint of the file system to the clipboard (e.g. fs-0123456789abcdef.example.com).
Return to your favorite text editor and replace “windows_remote_powershell_endpoint” with the Windows Remote PowerShell Endpoint of STG326 - SAZ. Copy the updated script.
Go to the remote desktop session for your Windows Instance 0.
Click Start >> Windows PowerShell.
Run the updated script in the Windows PowerShell window.
What commands are available to manage user sessions?
Run the command in the Remote Windows PowerShell Session window.
Get-Command *SmbSession*
What commands are available to manage open files?
Run the command in the Remote Windows PowerShell Session window.
Get-Command *Open*
Open a new Windows PowerShell window.
Run the DiskSpeed script below to test read performance of the mapped Z: drive in the new Windows PowerShell window.
$random = $(Get-Random)
fsutil file createnew Z:\${env:computername}-$random.dat 100000000000
C:\Tools\DiskSpd-2.0.21a\amd64\DiskSpd.exe -d120 -w0 -r -t1 -o32 -b64K -Su -L Z:\${env:computername}-$random.dat
While the script is running, go back to the Remote Windows PowerShell Session window.
Run the command in the Remote Windows PowerShell Session window.
Get-FSxSmbOpenFile
Do you see an open file?
Close the open file.
Run the command in the Remote Windows PowerShell Session window. Enter A for Yes to All at the prompt.
Close-FSxSmbOpenFile
What happened to the open file?
What happened to the DiskSpd command in the other PowerShell window?
End the remote PowerShell session. Run Exit-PSSession.
Close the PowerShell window. Run exit.