

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 Amazon FSx CLI 在 PowerShell 上進行遠端管理的一次性檔案系統設定任務
<a name="one-time-admin-tasks"></a>

使用下列 Amazon FSx CLI for Remote Management on PowerShell 命令，依照我們的最佳實務快速實作檔案系統管理任務。

## 管理儲存體耗用量
<a name="manage-disk-usage"></a>

使用下列命令來管理您的檔案系統儲存體使用量。
+ 若要使用預設排程開啟重複資料刪除，請執行下列命令。

  ```
  Invoke-Command -ComputerName $FSxWindowsRemotePowerShellEndpoint -ConfigurationName FSxRemoteAdmin -ScriptBlock { Enable-FsxDedup }
  ```

  或者，使用下列命令，在建立檔案後立即取得檔案上的重複資料刪除操作，而不需要任何檔案最短存留期。

  ```
  Invoke-Command -ComputerName $FSxWindowsRemotePowerShellEndpoint -ConfigurationName FSxRemoteAdmin -ScriptBlock { Set-FSxDedupConfiguration -MinimumFileAgeDays 0 }
  ```

  如需詳細資訊，請參閱[使用重複資料刪除來降低儲存成本](managing-storage-configuration.md#using-data-dedup)。

   
+ 使用下列命令以「追蹤」模式開啟使用者儲存配額，這僅用於報告目的，而非強制執行。

  ```
  $QuotaLimit = Quota limit in bytes
  $QuotaWarningLimit = Quota warning threshold in bytes
  Invoke-Command -ComputerName $FSxWindowsRemotePowerShellEndpoint -ConfigurationName FSxRemoteAdmin -ScriptBlock { Enable-FSxUserQuotas -Track -DefaultLimit $Using:QuotaLimit -DefaultWarningLimit $Using:QuotaWarningLimit }
  ```

  如需詳細資訊，請參閱[管理儲存配額](managing-user-quotas.md)。

## 開啟陰影複本，讓最終使用者能夠將檔案和資料夾復原至先前的版本
<a name="turn-on-shadow-copies"></a>

使用預設排程 （工作日上午 7 點和中午 12 點） 開啟陰影複製，如下所示。

```
Invoke-Command -ComputerName $FSxWindowsRemotePowerShellEndpoint -ConfigurationName FSxRemoteAdmin -ScriptBlock { Set-FsxShadowStorage -Default }
     
Invoke-Command -ComputerName $FSxWindowsRemotePowerShellEndpoint -ConfigurationName FSxRemoteAdmin -ScriptBlock { Set-FsxShadowCopySchedule -Default -Confirm:$False}
```

如需詳細資訊，請參閱[設定陰影複本以使用預設儲存體和排程](setting-up-fsx-shadow-copies.md)。

## 強制執行傳輸中的加密
<a name="admin-encryption"></a>

下列命令會對連線至檔案系統的用戶端強制執行加密。

```
Invoke-Command -ComputerName $FSxWindowsRemotePowerShellEndpoint -ConfigurationName FSxRemoteAdmin -ScriptBlock { Set-FsxSmbServerConfiguration -EncryptData $True -RejectUnencryptedAccess $True -Confirm:$False}
```

您可以關閉所有開啟的工作階段，並強制目前連線的用戶端使用加密重新連線。

```
Invoke-Command -ComputerName $FSxWindowsRemotePowerShellEndpoint -ConfigurationName FSxRemoteAdmin -ScriptBlock { Close-FSxSmbSession -Confirm:$False}
```

如需詳細資訊，請參閱[管理傳輸中的加密](encryption-in-transit.md#manage-encrypt-in-transit)及[使用者工作階段和開啟的檔案](manage-sessions-and-files.md)。