
모든 공유를 마운트할 수 있는 Windows 10 관리 콘솔이 있습니다. 관리 콘솔은 AD 도메인에 가입되어 있습니다. 우리는 관리자에서 파일 탐색기를 사용하고 있습니다. 사용자 디스크 할당량을 설정하는 콘솔입니다. 사용자 디스크 할당량을 설정하기 전에 모든 할당량 항목을 로드하는 데 오랜 시간이 걸립니다. 그렇다면 해당 작업을 수행할 수 있는 스크립트나 명령줄이 있습니까?
불행하게도 fsutil 유틸리티는 로컬 볼륨에만 사용됩니다.
답변1
# Check if Fsrm module is installed
if (-not (Get-Module -ListAvailable -Name Fsrm)) {
Write-Host "File Server Resource Manager module not installed. Please install it and run the script again."
return
}
# Import the File Server Resource Manager module
Import-Module Fsrm
# Specify the username and path to the folder you want to set quotas for
$username = "JohnDoe"
$folderPath = "C:\Users\$username\Documents"
# Set the quota limit (in bytes)
$quotaLimit = 500MB
# Create a new quota
New-FsrmQuota -Path $folderPath -UserName $username -Size $quotaLimit -Enforce
# Optionally, you can set an email notification for the user
Set-FsrmQuota -Path $folderPath -UserName $username -Notification $true -NotificationLimit $quotaLimit
할당량 템플릿을 사용하는 경우 PowerShell을 사용하여 템플릿을 할당할 수 있습니다.
# Import the File Server Resource Manager module
Import-Module Fsrm
# Specify the username and path to the folder you want to set quotas for
$username = "JohnDoe"
$folderPath = "C:\Users\$username\Documents"
# Specify the name of the quota template
$quotaTemplateName = "StandardTemplate"
# Assign the quota template to the folder
Set-FsrmQuota -Path $folderPath -UserName $username -TemplateName $quotaTemplateName
할당량에 fsrm을 사용한다고 가정했습니다. 원격 드라이브에서는 이 작업을 수행할 수 없으며 데이터를 호스팅하는 파일 서버에서 수행해야 합니다.