Skip to content

Instantly share code, notes, and snippets.

@pax8-dkirby
Created October 13, 2020 16:10
Show Gist options
  • Save pax8-dkirby/b188eddcc2421326ea89149f57c72e0d to your computer and use it in GitHub Desktop.
Save pax8-dkirby/b188eddcc2421326ea89149f57c72e0d to your computer and use it in GitHub Desktop.
Configures Windows 10 Client OS VSS for SentinelOne.
<#
.SYNOPSIS
Configures Windows 10 Client OS VSS for SentinelOne.
.DESCRIPTION
.PARAMETER
.EXAMPLE
.INPUTS
.OUTPUTS
.LINK
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc754968(v=ws.10)
.NOTES
Initial
2020-09-09
Brian Sexton
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#>
# set max shadow copy storage to 10%
# All FIxed DIsk's, No Removable Disks
$VssAdminFullPath = "C:\Windows\System32\vssadmin.exe"
try {
Set-Service -Name VSS -StartupType Automatic -Status Running -ErrorAction Stop
} catch {
Write-Error -Message "Failed to configure VSS Service" -Category OperationStopped
break;
}
[array]$drives = (Get-PSDrive -PSProvider 'FileSystem' | Where-Object { $_.Free -ne $null }).Name
ForEach ($driveletter in $drives) {
if ((Get-Volume -DriveLetter $driveletter).DriveType -eq 'Fixed') {
try {
Enable-ComputerRestore -Drive "$driveletter`:"
Start-Sleep -Seconds 5
Start-Process -FilePath $VssAdminFullPath -ArgumentList "resize ShadowStorage /For=$driveletter`: /On=$driveletter`: /MaxSize=10%" -WindowStyle Hidden
} catch {
Write-Error -Message "Failed to configure VSS for SentinelOne" -Category OperationStopped
}
}
}
try {
Checkpoint-Computer -Description "VSS Checkpoint for SentinelOne" -RestorePointType MODIFY_SETTINGS
} catch {
Write-Error -Message "Failed to Create System Checkpoint" -Category OperationStopped
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment