Skip to content

Instantly share code, notes, and snippets.

@psrdrgz
Last active March 11, 2020 16:04
Show Gist options
  • Save psrdrgz/63128933373b3896715b4fccd603868e to your computer and use it in GitHub Desktop.
Save psrdrgz/63128933373b3896715b4fccd603868e to your computer and use it in GitHub Desktop.
SMBGhost Stuff for ConfigMgr
# Create ConfigMgr Script to set DisableCompression to 1
New-CMScript -ScriptText 'Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" DisableCompression -Type DWORD -Value 1 -Force' -ScriptName 'ADV200005 - Disable SMBv3 Compression' -Fast
# Create ConfigMgr Script to set DisableCompression to 0
New-CMScript -ScriptText 'Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" DisableCompression -Type DWORD -Value 0 -Force' -ScriptName 'ADV200005 - Re-Enable SMBv3 Compression' -Fast
# Approve ADV200005 scripts
Get-CMScript -ScriptName 'ADV200005*' -Fast | Approve-CMScript
# Set DisableCompression to 1 on All Desktop and Server Clients collection
# Get-CMScript -ScriptName 'ADV200005 - Disable SMBv3 Compression' | Invoke-CMScript -CollectionName 'All Desktop and Server Clients'
<# CMPivot Query For DisableCompression value
Device
| join kind=leftouter (
Registry('HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters')
| where Property == 'DisableCompression'
| project Device, DisableCompression=Value
)
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment