Manage user sessions and open files

Manage user sessions and open files

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.

Manage user sessions and open files using the UI

Important

Read through all steps below and watch the quick video before continuing.

manage-sessions-files-ui.gif

  1. 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.

  2. Go to the remote desktop session for your Windows Instance 0.

  3. Click Start.

  4. Type fsmgmt.msc.

  5. From the Shared Folders Console, select Action >> Connect to another computer….

  6. Paste the DNS Name copied above in the Another computer: text box and click Ok.

  7. From the left pane select Sessions.

  8. Review the open sessions to the file system.

  9. From the left pane select Open Files.

  10. Review the open files of the file system.

  11. Keep the Shared Folders Console open.

  12. 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).

  13. 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
  1. While the script is running, go back to the Shared Folders Console and refresh the Open Files view.

  2. Do you see an open file?

    Tip

    Check your email. You should eventually get a High Throughput Alarm email.

  3. 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.

  4. What happened to the open file?

  5. What happened to the DiskSpd command in the PowerShell window?

  6. Close the PowerShell window. Run exit.

  7. Close the Shared Folders Console.

Manage user sessions and open files using the Amazon FSx CLI for Remote Management on PowerShell.

Important

Read through all steps below and watch the quick video before continuing.

manage-sessions-files-cli.gif

  1. 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
    
  2. 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).

  3. 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.

  4. Go to the remote desktop session for your Windows Instance 0.

  5. Click Start >> Windows PowerShell.

  6. Run the updated script in the Windows PowerShell window.

  7. What commands are available to manage user sessions?

    • Run the command in the Remote Windows PowerShell Session window.

      Get-Command *SmbSession*
      
  8. What commands are available to manage open files?

    • Run the command in the Remote Windows PowerShell Session window.

      Get-Command *Open*
      
  9. Open a new Windows PowerShell window.

    • Click Start >> Windows PowerShell.
  10. 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
  1. While the script is running, go back to the Remote Windows PowerShell Session window.

  2. Run the command in the Remote Windows PowerShell Session window.

Get-FSxSmbOpenFile
  1. Do you see an open file?

  2. Close the open file.

  3. Run the command in the Remote Windows PowerShell Session window. Enter A for Yes to All at the prompt.

Close-FSxSmbOpenFile
  1. What happened to the open file?

  2. What happened to the DiskSpd command in the other PowerShell window?

  3. End the remote PowerShell session. Run Exit-PSSession.

  4. Close the PowerShell window. Run exit.