使用 Amazon FSx CLI 進行遠端管理的一次性檔案系統設定任務 PowerShell - Amazon FSx 文件服务器

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

使用 Amazon FSx CLI 進行遠端管理的一次性檔案系統設定任務 PowerShell

使用下列 Amazon FSx CLI 進行遠端管理 PowerShell命令,以按照我們的最佳實務快速實作檔案系統管理任務。

管理儲存體使用

使用下列指令來管理您的檔案系統儲存空間耗用量。

  • 若要以預設排程開啟重複資料刪除功能,請執行下列命令。

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

    您也可以選擇使用下列指令,在建立檔案後立即在檔案上執行重複資料刪除作業,而不需要任何最低檔案保留時間。

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

    如需詳細資訊,請參閱利用重複資料刪除技術降低儲存成

     

  • 使用下列命令在「追蹤」模式下開啟使用者儲存配額,此模式僅用於報告目的,而不是用於強制執行。

    $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 }

    如需詳細資訊,請參閱管理儲存配額

開啟陰影複製,讓終端使用者能夠將檔案和資料夾復原至先前的版本

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

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

如需詳細資訊,請參閱設定陰影複製以使用預設儲存區和排程

在傳輸中強制執行加密

下列指令會強制為連線至檔案系統的用戶端強制加密。

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}

如需詳細資訊,請參閱 管理傳輸中的加密用戶會話和打開文件