Invoke-sqmNtfsSetup
Maintenance sqmSQLTool v1.8.2+
Grants the SQL Server service accounts NTFS permissions on the instance's data, log, TempDB and backup directories (with an ACL backup beforehand).

Examples

Invoke-sqmNtfsSetup -SqlInstance "SQL01"
Invoke-sqmNtfsSetup -SqlInstance "SQL01"
Auto-discovers the service accounts and SQL directories and grants FullControl.
Invoke-sqmNtfsSetup -SqlInstance "SQL01\INST01" -Permission Modify -WhatIf
Invoke-sqmNtfsSetup -SqlInstance "SQL01\INST01" -Permission Modify -WhatIf
Shows which accounts would get Modify on which directories, without changing anything.
Invoke-sqmNtfsSetup -Directory 'E:\MSSQL\DATA','F:\MSSQL\LOG' -Account 'NT SERVICE\MSSQLSERVER'
Invoke-sqmNtfsSetup -Directory 'E:\MSSQL\DATA','F:\MSSQL\LOG' -Account 'NT SERVICE\MSSQLSERVER'
Sets permissions only on the given directories for the given account.