Home
%3CLINGO-SUB%20id%3D%22lingo-sub-884830%22%20slang%3D%22en-US%22%3EDisable%20SMBv1%20in%20your%20environments%20with%20Configuration%20Manager%20Compliance%20Settings%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-884830%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%20First%20published%20on%20TECHNET%20on%20May%2022%2C%202017%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CI%3E%20Authored%20by%20Cameron%20Cox%20%3C%2FI%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%20I%20have%20updated%20this%20blog%20to%20remove%20SMB1%20LanmanServer%20from%202012%2F8%2B.%20%3CBR%20%2F%3E%3CBR%20%2F%3EThere%20has%20been%20lots%20of%20buzz%20over%20the%20recent%20ransomware%20attacks.%20One%20of%20the%20mitigations%20to%20keep%20the%20attack%20from%20spreading%20is%20disabling%20SMBv1%20on%20all%20your%20Windows%20workstation%20and%20servers.%20One%20of%20the%20easy%20ways%20to%20deploy%20this%20out%2C%20while%20also%20having%20reports%20to%20confirm%20the%20settings%20are%20set%20correctly%2C%20is%20the%20use%20of%20Configuration%20Managers%20Compliance%20Settings%2C%20also%20known%20as%20Desired%20Configuration%20Management%20(DCM).%20Using%20compliance%20settings%20makes%20rolling%20out%20this%20change%20a%20breeze%20and%20allows%20you%20to%20update%20your%26nbsp%3Bsecurity%20teams%20with%20reports%20to%20show%20the%20progress%20of%20the%20roll%20out.%20Below%20are%20the%20detailed%20instructions%20on%20how%20setup%2C%20configure%20and%20deploy%20these%20settings.%20%3CBR%20%2F%3E%3CBR%20%2F%3EFirst%2C%20all%20the%20documentation%20on%20how%20to%20disable%20SMBv1%20can%20be%20found%20here%20.%20%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20can%20also%20do%20this%20with%20group%20policy%20preferences%2C%20keep%20in%20mind%2C%20group%20policy%20does%20not%20have%20a%20reporting%20system%20built%20into%20it.%20The%26nbsp%3Binstructions%2C%20along%20with%20some%20really%20good%20information%20on%20the%20ransomware%20attack%20can%20be%20found%20here%20.%20%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20can%20also%20do%20this%20with%20Desired%20State%20Configuration%20(DSC).%20A%20friend%20of%20mine%20in%20the%20consulting%20side%20of%20services%2C%20Ralph%20Kyttle%2C%20put%20together%20instructions%20for%20DSC%2C%20leveraging%20a%20DSC%20tool%20he%20help%20build%2C%20called%20the%20Desired%20State%20Configuration%20Environment%20Analyzer%20(DSCEA).%20The%20instructions%20can%20be%20found%20here%20.%20The%20DSCEA%20tool%20can%20be%20found%20here%20.%20%3CBR%20%2F%3E%3CBR%20%2F%3ELet%E2%80%99s%20begin!%20%3CBR%20%2F%3E%3CBR%20%2F%3EFirst%2C%20we%20need%20to%20create%20the%20detection%20and%20remediation%20scripts%20for%20both%20LanmanServer%20and%20LanmanWorkstation.%20%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20LanmanServer%20pre-2012%2F8%20is%20straight%20forward%20as%20we%20only%20need%20to%20find%20a%20single%20registry%20key.%20For%202012%2F8%2B%20we%20need%20to%20gather%20the%20SMB%201%20feature%20for%20windows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkgreen%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%23%23%20LANMANSERVER%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkgreen%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%23%23%20Detection%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20%23a82d00%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%24SMBv1Compliance%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E1%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20%23a82d00%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%24SMBServer%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ItemProperty%3C%2FSPAN%3E%20%3CSPAN%3E-Path%3C%2FSPAN%3E%20%3CSPAN%3E%22HKLM%3A%5CSYSTEM%5CCurrentControlSet%5CServices%5CLanmanServer%5CParameters%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20%23a82d00%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%24Win10%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3EGet-WmiObject%3C%2FSPAN%3E%20%3CSPAN%3E-Class%3C%2FSPAN%3E%20%3CSPAN%3EWin32_OperatingSystem%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3ECaption%20%3C%2FSPAN%3E%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EWhere-Object%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%7B%3C%2FSPAN%3E%3CSPAN%3E%24_%3C%2FSPAN%3E%20%3CSPAN%3E-like%3C%2FSPAN%3E%20%3CSPAN%3E%22Microsoft%20Windows%2010%20*%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20%23a82d00%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%24Win2016%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3EGet-WmiObject%3C%2FSPAN%3E%20%3CSPAN%3E-Class%3C%2FSPAN%3E%20%3CSPAN%3EWin32_OperatingSystem%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3ECaption%20%3C%2FSPAN%3E%3CSPAN%3E%7C%3C%2FSPAN%3E%20%3CSPAN%3EWhere-Object%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%7B%3C%2FSPAN%3E%3CSPAN%3E%24_%3C%2FSPAN%3E%20%3CSPAN%3E-like%3C%2FSPAN%3E%20%3CSPAN%3E%22Microsoft%20Windows%20Server%202016%20*%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkblue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EIF%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24Win10%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%20%7B%20%3C%2FSPAN%3E%3CSPAN%3E%24Win10SMB1%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3EGet-WindowsOptionalFeature%3C%2FSPAN%3E%20%3CSPAN%3E-Online%3C%2FSPAN%3E%20%3CSPAN%3E-FeatureName%3C%2FSPAN%3E%20%3CSPAN%3ESMB1Protocol%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EState%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EToString()%20%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkblue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EIF%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24Win2016%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%20%7B%20%3C%2FSPAN%3E%3CSPAN%3E%24Win2016SMB1%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3EGet-WindowsFeature%3C%2FSPAN%3E%20%3CSPAN%3E-Name%3C%2FSPAN%3E%20%3CSPAN%3EFS-SMB1%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EInstallState%20%7D%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkblue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EIF%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%20((%3C%2FSPAN%3E%3CSPAN%3E%24Win10SMB1%3C%2FSPAN%3E%20%3CSPAN%3E-like%3C%2FSPAN%3E%20%3CSPAN%3E%22Enabled%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%20%3C%2FSPAN%3E%3CSPAN%3E-or%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24Win2016SMB1%3C%2FSPAN%3E%20%3CSPAN%3E-like%3C%2FSPAN%3E%20%3CSPAN%3E%22Installed%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E))%20%3C%2FSPAN%3E%3CSPAN%3E-or%3C%2FSPAN%3E%20%3CSPAN%3E%24SMBServer%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3ESMB1%20%3C%2FSPAN%3E%3CSPAN%3E-eq%3C%2FSPAN%3E%20%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20)%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%24SMBv1Compliance%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkblue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EELSE%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%24SMBv1Compliance%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%24SMBv1Compliance%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3EFor%20remediation%2C%20pre-2012%2F8%20we%20will%20need%20to%20just%20set%20the%20registry%20value%20to%200%2C%20for%202012%2B%20we%20need%20to%20actually%20remove%20the%20feature.%20Once%20we%20restart%20the%20service%20we%20will%20operating%20without%20SMB1.%20Note%3A%20You%20will%20have%20a%20pending%20reboot%20for%202012%2F8%2B%20server%20and%20client.%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkgreen%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%23%23%20Remediation%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20%23a82d00%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%24WinVersion%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3EGet-WmiObject%3C%2FSPAN%3E%20%3CSPAN%3E-Class%3C%2FSPAN%3E%20%3CSPAN%3EWin32_OperatingSystem%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EVersion%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkblue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3ESwitch%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E-Wildcard%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24WinVersion%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%2210.*%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3EDisable-WindowsOptionalFeature%3C%2FSPAN%3E%20%3CSPAN%3E-Online%3C%2FSPAN%3E%20%3CSPAN%3E-FeatureName%3C%2FSPAN%3E%20%3CSPAN%3Esmb1protocol%3C%2FSPAN%3E%20%3CSPAN%3E-Norestart%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%228.*%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3EDisable-WindowsOptionalFeature%3C%2FSPAN%3E%20%3CSPAN%3E-Online%3C%2FSPAN%3E%20%3CSPAN%3E-FeatureName%3C%2FSPAN%3E%20%3CSPAN%3Esmb1protocol%3C%2FSPAN%3E%20%3CSPAN%3E-Norestart%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%226.*%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3ESet-ItemProperty%3C%2FSPAN%3E%20%3CSPAN%3E-Path%3C%2FSPAN%3E%20%3CSPAN%3E%E2%80%9CHKLM%3A%5CSYSTEM%5CCurrentControlSet%5CServices%5CLanmanServer%5CParameters%E2%80%9D%3C%2FSPAN%3E%20%3CSPAN%3ESMB1%3C%2FSPAN%3E%20%3CSPAN%3E-Value%3C%2FSPAN%3E%20%3CSPAN%3E0%3C%2FSPAN%3E%20%3CSPAN%3E%E2%80%93Force%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20blue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3ERestart-Service%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E-Name%3C%2FSPAN%3E%20%3CSPAN%3ELanmanServer%3C%2FSPAN%3E%20%3CSPAN%3E-Force%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3EFor%20LanmanWorkstation%20this%20scenario%20is%20not%20as%20straight%20forward%20as%20we%20have%20REG_MULTI_STRING%20we%20need%20to%20evaluate%20and%20ensure%20the%20value%20for%20SMBv1%20is%20not%20present.%20We%20also%20need%20to%20ensure%20the%20SMBv1%20service%20is%20not%20running.%20This%20means%20we%20need%20to%20add%20some%20logic%20to%20the%20detection%20script.%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkgreen%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%23%23%20LanmanWorkstation%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkgreen%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%23%23%20Detection%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20orangered%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%24SMBClient%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3EGet-ItemProperty%3C%2FSPAN%3E%20%3CSPAN%3E-Path%3C%2FSPAN%3E%20%3CSPAN%3E%E2%80%9CHKLM%3A%5CSYSTEM%5CCurrentControlSet%5CServices%5CLanmanWorkstation%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20orangered%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%24SMBv1Status%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%24(%3C%2FSPAN%3E%3CSPAN%3EGet-Service%3C%2FSPAN%3E%20%3CSPAN%3E-Name%3C%2FSPAN%3E%20%3CSPAN%3Emrxsmb10%20%3C%2FSPAN%3E%3CSPAN%3E-ErrorAction%3C%2FSPAN%3E%20%3CSPAN%3ESilentlyContinue%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EStatus%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkblue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EIF%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20((%3C%2FSPAN%3E%3CSPAN%3E%24SMBClient%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EDependOnService%20%3C%2FSPAN%3E%3CSPAN%3E-contains%3C%2FSPAN%3E%20%3CSPAN%3E%22MRxSmb10%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E)%20%3C%2FSPAN%3E%3CSPAN%3E-or%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%3E%24SMBv1Status%3C%2FSPAN%3E%20%3CSPAN%3E-eq%3C%2FSPAN%3E%20%3CSPAN%3E%22Running%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E))%20%7B%3C%2FSPAN%3E%3CSPAN%3E%24false%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%20%3C%2FSPAN%3E%3CSPAN%3EELSE%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%7B%3C%2FSPAN%3E%3CSPAN%3E%24true%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3EThis%20reads%20the%20value%20of%20the%20%3CSTRONG%3E%20DependOnService%20%3C%2FSTRONG%3E%20property%20and%20verifies%20%3CSTRONG%3E%20MRxSmb10%20%3C%2FSTRONG%3E%20is%20not%20in%20the%20list.%20%20%3CSTRONG%3EMRxSmb10%20%3C%2FSTRONG%3E%20is%20the%20SMBv1%20service%20found%20in%20Windows%20where%20SMBv1%20is%20still%20on%20by%20default.%20In%20this%20case%20I%20am%20using%20reverse%20logic%2C%20I%20am%20checking%20for%20the%20state%20that%20I%20don%E2%80%99t%20want%20the%20services%20to%20be%20in.%20If%20we%20find%20the%20services%20are%20in%20their%20default%20state%2C%20we%20return%20a%20Boolean%20%24false%2C%20which%20will%20represent%20a%20non-compliant%20machine%20and%20will%20be%20the%20trigger%20for%20running%20the%20remediation%20script.%20%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20remediation%2C%20we%20will%20configure%20the%20services%20to%20no%20longer%20depend%20on%20SMBv1%20and%20disabled%20the%20SMBv1%20service.%20We%20will%20then%20restart%20the%20services%20and%20stop%20the%20SMBv1%20service.%20This%20will%20ensure%20the%20changes%20will%20take%20effect%20immediately.%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20darkgreen%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%23%23%20Remediation%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20blue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EInvoke-Command%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%7B%3C%2FSPAN%3E%3CSPAN%3Ecmd%3C%2FSPAN%3E%20%3CSPAN%3E%2Fc%3C%2FSPAN%3E%20%3CSPAN%3Esc.exe%3C%2FSPAN%3E%20%3CSPAN%3Econfig%3C%2FSPAN%3E%20%3CSPAN%3Elanmanworkstation%3C%2FSPAN%3E%20%3CSPAN%3Edepend%3D%3C%2FSPAN%3E%20%3CSPAN%3Ebowser%2Fmrxsmb20%2Fnsi%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20blue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EInvoke-Command%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%7B%3C%2FSPAN%3E%3CSPAN%3Ecmd%3C%2FSPAN%3E%20%3CSPAN%3E%2Fc%3C%2FSPAN%3E%20%3CSPAN%3Esc.exe%3C%2FSPAN%3E%20%3CSPAN%3Econfig%3C%2FSPAN%3E%20%3CSPAN%3Emrxsmb10%3C%2FSPAN%3E%20%3CSPAN%3Estart%3D%3C%2FSPAN%3E%20%3CSPAN%3Edisabled%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20blue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3ERestart-Service%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E-Name%3C%2FSPAN%3E%20%3CSPAN%3ELanmanWorkstation%3C%2FSPAN%3E%20%3CSPAN%3E-Force%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20blue%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3EStop-Service%3C%2FSPAN%3E%3CSPAN%20style%3D%22margin%3A%200px%3B%20font-family%3A%20'Lucida%20Console'%3B%20font-size%3A%209pt%3B%22%3E%20%3CSPAN%3E-Name%3C%2FSPAN%3E%20%3CSPAN%3Emrxsmb10%3C%2FSPAN%3E%20%3CSPAN%3E-Force%3C%2FSPAN%3E%3CSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3ENow%20to%20take%20the%20scripts%20and%20plug%20them%20into%20Compliance%20Settings.%20%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20need%20to%20create%20a%20new%20configuration%20item%2C%20and%20give%20it%20a%20name%20that%20aligns%20with%20a%20naming%20convention%20and%20can%20easily%20be%20identified.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20773px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134763i69141B80FC52E400%2Fimage-dimensions%2F773x733%3Fv%3D1.0%22%20width%3D%22773%22%20height%3D%22733%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20need%20to%20remove%20the%20operating%20systems%20that%20we%20know%20this%20will%20break.%20In%20my%20lab%2C%20I%20am%20removing%20All%20Windows%20XP%2C%20and%20Server%202003%20variants.%20In%20your%20environment%2C%20you%20might%20want%20to%20disable%20SMB%20on%20these%20versions%2C%20just%20keep%20in%20mind%2C%20anything%20prior%20to%20Vista%20only%20has%20SMBv1%2C%20meaning%20it%20will%20break%20SMB%20functionality%20on%20those%20machines.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20769px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134764i411FAB6DAE5846E7%2Fimage-dimensions%2F769x732%3Fv%3D1.0%22%20width%3D%22769%22%20height%3D%22732%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20need%20to%20setup%20the%20first%20setting%20for%20LanmanServer%2C%20be%20sure%20to%20set%20the%20%3CSTRONG%3E%20Setting%20Type%26nbsp%3Bto%20Script%20and%20Data%20Type%20to%20Integer%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20771px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134765i1C13B98C64082051%2Fimage-dimensions%2F771x733%3Fv%3D1.0%22%20width%3D%22771%22%20height%3D%22733%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ECopy%20in%20the%20detection%20script%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20769px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134766i61D2B4A20B04ED7F%2Fimage-dimensions%2F769x732%3Fv%3D1.0%22%20width%3D%22769%22%20height%3D%22732%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ECopy%20in%20the%20remediation%20script%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20769px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134767i6A081D6E7B7434AE%2Fimage-dimensions%2F769x731%3Fv%3D1.0%22%20width%3D%22769%22%20height%3D%22731%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ESetup%20the%20compliance%20rule%20to%20equal%20%3CSTRONG%3E%20Zero%20(0)%20%3C%2FSTRONG%3E%20%2C%20%3CSTRONG%3E%20turn%20on%20remediation%20%3C%2FSTRONG%3E%20and%20%3CSTRONG%3E%20report%20non-compliance%20if%20setting%20instance%20is%20not%20found%3C%2FSTRONG%3E.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20769px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134768i5F7835BB327EF718%2Fimage-dimensions%2F769x730%3Fv%3D1.0%22%20width%3D%22769%22%20height%3D%22730%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ENow%20to%20setup%20the%20setting%20for%20LanmanWorkstation%2C%20be%20sure%20to%20set%20the%20%3CSTRONG%3E%20Setting%20Type%26nbsp%3Bto%20Script%20and%20Data%20Type%20to%20%3C%2FSTRONG%3E%20%3CSTRONG%3E%20Boolean%20%3C%2FSTRONG%3E%20.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20769px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134769iABFA239EA5B0186B%2Fimage-dimensions%2F769x732%3Fv%3D1.0%22%20width%3D%22769%22%20height%3D%22732%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ECopy%20in%20the%20detection%20script%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20770px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134770i995BDC8B1087EA6C%2Fimage-dimensions%2F770x732%3Fv%3D1.0%22%20width%3D%22770%22%20height%3D%22732%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ECopy%20in%20the%20remediation%20script%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20768px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134771i7EC9D2FDEAE3AE8F%2Fimage-dimensions%2F768x732%3Fv%3D1.0%22%20width%3D%22768%22%20height%3D%22732%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ESetup%20the%20%3CSTRONG%3E%20compliance%20rule%20to%20equal%20true%20%3C%2FSTRONG%3E%20and%20%3CSTRONG%3E%20turn%20on%20remediation%20%3C%2FSTRONG%3E%20and%20%3CSTRONG%3E%20report%20noncompliance%20if%20this%20settings%20instance%20is%20not%20found%20%3C%2FSTRONG%3E%20.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20606px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134772iA3271738863C3D13%2Fimage-dimensions%2F606x629%3Fv%3D1.0%22%20width%3D%22606%22%20height%3D%22629%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFinish%20out%20the%20wizard.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20768px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134773i9A2D6348E06BF6F1%2Fimage-dimensions%2F768x731%3Fv%3D1.0%22%20width%3D%22768%22%20height%3D%22731%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ENow%20we%20need%20to%20create%20the%20baseline%2C%20and%20add%20the%20CI%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20622px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134774i3CECA99978AE74E1%2Fimage-dimensions%2F622x573%3Fv%3D1.0%22%20width%3D%22622%22%20height%3D%22573%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3ECreate%20the%20collection%20for%20deployment%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20399px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134775i941AE13B1BF0F8D5%2Fimage-dimensions%2F399x24%3Fv%3D1.0%22%20width%3D%22399%22%20height%3D%2224%22%20%2F%3E%3C%2FSPAN%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EDeploy%20the%20Baseline.%20%3CBR%20%2F%3E%3CBR%20%2F%3EI%20recommend%20manually%20running%20some%20of%20the%20scripts%20on%20a%20few%20machines%20and%20drop%20in%20a%20few%20machines%20that%20are%20not%20compliant%20before%20turning%20remediation%20on%2C%20in%20the%20deployment.%20This%20will%20allow%20you%20to%20test%20the%20logic.%20Once%20you%20are%20comfortable%20with%20your%20testing%2C%20start%20rolling%20out%20this%20slowly%20to%20machines%20and%2For%20servers.%20Remember%20just%20because%20the%20OS%20can%20communicate%20over%20SMBv2%2F3%20doesn%E2%80%99t%20mean%20your%20applications%20are%20programmed%20to%20allow%20the%20OS%20to%20handle%20the%20communication.%20Some%20applications%20may%20have%20SMBv1%20hardcoded%2C%20so%20be%20sure%20to%20test%20this%20in%20your%20environment.%20%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps!%20%3CBR%20%2F%3E%3CBR%20%2F%3ECameron%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3E%20%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20%23333333%3B%20font-family%3A%20'Segoe%20UI'%2Csans-serif%3B%20font-size%3A%2010.5pt%3B%22%3E%20Disclaimer%3A%20%3C%2FSPAN%3E%20%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22margin%3A%200px%3B%20color%3A%20%23333333%3B%20font-family%3A%20'Segoe%20UI'%2Csans-serif%3B%20font-size%3A%2010.5pt%3B%22%3E%20The%20information%20on%20this%20site%20is%20provided%20%E2%80%9CAS%20IS%E2%80%9D%20with%20no%20warranties%2C%20confers%20no%20rights%2C%20and%20is%20not%20supported%20by%20the%20authors%20or%20Microsoft%20Corporation.%20Use%20of%20any%20included%20script%20samples%20are%20subject%20to%20the%20terms%20specified%20in%20the%20%20%20Terms%20of%20Use%20%20%20%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-884830%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20published%20on%20TECHNET%20on%20May%2022%2C%202017%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20has%20been%20lots%20of%20buzz%20over%20the%20recent%20ransomware%20attacks.%20One%20of%20the%20mitigations%20to%20keep%20the%20attack%20from%20spreading%20is%20disabling%20SMBv1%20on%20all%20your%20Windows%20workstation%20and%20servers.%20One%20of%20the%20easy%20ways%20to%20deploy%20this%20out%2C%20while%20also%20having%20reports%20to%20confirm%20the%20settings%20are%20set%20correctly%2C%20is%20the%20use%20of%20Configuration%20Managers%20Compliance%20Settings%2C%20also%20known%20as%20Desired%20Configuration%20Management%20(DCM).%20Using%20compliance%20settings%20makes%20rolling%20out%20this%20change%20a%20breeze%20and%20allows%20you%20to%20update%20your%26nbsp%3Bsecurity%20teams%20with%20reports%20to%20show%20the%20progress%20of%20the%20roll%20out.%20Below%20are%20the%20detailed%20instructions%20on%20how%20setup%2C%20configure%20and%20deploy%20these%20settings.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-884830%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECameronCox%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

First published on TECHNET on May 22, 2017

Authored by Cameron Cox


NOTE: I have updated this blog to remove SMB1 LanmanServer from 2012/8+.

There has been lots of buzz over the recent ransomware attacks. One of the mitigations to keep the attack from spreading is disabling SMBv1 on all your Windows workstation and servers. One of the easy ways to deploy this out, while also having reports to confirm the settings are set correctly, is the use of Configuration Managers Compliance Settings, also known as Desired Configuration Management (DCM). Using compliance settings makes rolling out this change a breeze and allows you to update your security teams with reports to show the progress of the roll out. Below are the detailed instructions on how setup, configure and deploy these settings.

First, all the documentation on how to disable SMBv1 can be found here .

You can also do this with group policy preferences, keep in mind, group policy does not have a reporting system built into it. The instructions, along with some really good information on the ransomware attack can be found here .

You can also do this with Desired State Configuration (DSC). A friend of mine in the consulting side of services, Ralph Kyttle, put together instructions for DSC, leveraging a DSC tool he help build, called the Desired State Configuration Environment Analyzer (DSCEA). The instructions can be found here . The DSCEA tool can be found here .

Let’s begin!

First, we need to create the detection and remediation scripts for both LanmanServer and LanmanWorkstation.

For LanmanServer pre-2012/8 is straight forward as we only need to find a single registry key. For 2012/8+ we need to gather the SMB 1 feature for windows.

 

## LANMANSERVER
## Detection
$SMBv1Compliance = 1

$SMBServer = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters"
$Win10 = (Get-WmiObject -Class Win32_OperatingSystem).Caption | Where-Object {$_ -like "Microsoft Windows 10 *"}
$Win2016 = (Get-WmiObject -Class Win32_OperatingSystem).Caption | Where-Object {$_ -like "Microsoft Windows Server 2016 *"}
IF ($Win10) { $Win10SMB1 = (Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol).State.ToString() }
IF ($Win2016) { $Win2016SMB1 = (Get-WindowsFeature -Name FS-SMB1).InstallState }
IF ( (($Win10SMB1 -like "Enabled") -or ($Win2016SMB1 -like "Installed")) -or $SMBServer.SMB1 -eq 1 )
{
    $SMBv1Compliance
}
ELSE
{
    $SMBv1Compliance = 0
    $SMBv1Compliance
}


For remediation, pre-2012/8 we will need to just set the registry value to 0, for 2012+ we need to actually remove the feature. Once we restart the service we will operating without SMB1. Note: You will have a pending reboot for 2012/8+ server and client.

 

## Remediation 
$WinVersion = (Get-WmiObject -Class Win32_OperatingSystem).Version
Switch -Wildcard ($WinVersion)
{
    "10.*"
    {
        Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -Norestart
    }
    "8.*"
    {
        Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -Norestart
    }
    "6.*"
    {
        Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” SMB1 -Value 0 –Force
    }
}
Restart-Service -Name LanmanServer -Force


For LanmanWorkstation this scenario is not as straight forward as we have REG_MULTI_STRING we need to evaluate and ensure the value for SMBv1 is not present. We also need to ensure the SMBv1 service is not running. This means we need to add some logic to the detection script.

 

## LanmanWorkstation
## Detection
$SMBClient = Get-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation"
$SMBv1Status = $(Get-Service -Name mrxsmb10 -ErrorAction SilentlyContinue).Status
IF (($SMBClient.DependOnService -contains "MRxSmb10") -or ($SMBv1Status -eq "Running")) {$false} ELSE {$true}


This reads the value of the DependOnService property and verifies MRxSmb10 is not in the list. MRxSmb10 is the SMBv1 service found in Windows where SMBv1 is still on by default. In this case I am using reverse logic, I am checking for the state that I don’t want the services to be in. If we find the services are in their default state, we return a Boolean $false, which will represent a non-compliant machine and will be the trigger for running the remediation script.

For remediation, we will configure the services to no longer depend on SMBv1 and disabled the SMBv1 service. We will then restart the services and stop the SMBv1 service. This will ensure the changes will take effect immediately.

 

## Remediation
Invoke-Command {cmd /c sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi}
Invoke-Command {cmd /c sc.exe config mrxsmb10 start= disabled}
Restart-Service -Name LanmanWorkstation -Force
Stop-Service -Name mrxsmb10 -Force 


Now to take the scripts and plug them into Compliance Settings.

We need to create a new configuration item, and give it a name that aligns with a naming convention and can easily be identified.



We need to remove the operating systems that we know this will break. In my lab, I am removing All Windows XP, and Server 2003 variants. In your environment, you might want to disable SMB on these versions, just keep in mind, anything prior to Vista only has SMBv1, meaning it will break SMB functionality on those machines.



We need to setup the first setting for LanmanServer, be sure to set the Setting Type to Script and Data Type to Integer



Copy in the detection script



Copy in the remediation script




Setup the compliance rule to equal Zero (0) , turn on remediation and report non-compliance if setting instance is not found.



Now to setup the setting for LanmanWorkstation, be sure to set the Setting Type to Script and Data Type to Boolean .



Copy in the detection script



Copy in the remediation script



Setup the compliance rule to equal true and turn on remediation and report noncompliance if this settings instance is not found .

 

Finish out the wizard.



Now we need to create the baseline, and add the CI



Create the collection for deployment



Deploy the Baseline.

I recommend manually running some of the scripts on a few machines and drop in a few machines that are not compliant before turning remediation on, in the deployment. This will allow you to test the logic. Once you are comfortable with your testing, start rolling out this slowly to machines and/or servers. Remember just because the OS can communicate over SMBv2/3 doesn’t mean your applications are programmed to allow the OS to handle the communication. Some applications may have SMBv1 hardcoded, so be sure to test this in your environment.

Hope this helps!

Cameron

Disclaimer: The information on this site is provided “AS IS” with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of any included script samples are subject to the terms specified in the Terms of Use