Disable Windows Server 2016+ Group Policy Logon Script Delay

Something that bit me in the butt back at the release of Server 2016, and I can laugh now, is the Group Policy Logon Script Delay “feature”. I lost a few hours trying to figure out why my GPO user logon scripts I was created weren’t seemingly running even though RSOP told me they were. Turns out, Server 2016 and newer implement a delay on user Group Policy scripts for performance reasons (quicker logon/user experience).

To Disable

Computer Configuration\Administrative Templates\System\Group Policy: Configure Logon Script Delay: Enabled

Set the value (integer) in minutes. 0 being no delay and maximum 1,000 (why? lol)

Reference: https://support.microsoft.com/en-us/help/2895815/logon-scripts-do-not-run-for-five-minutes-after-a-user-logs-on-to-a-wi

Enable Disk Performance Counters (Server 2012R2 and newer)

Disk performance counters were disabled by default in Server 2012 R2 and onward due to performance reasons in collecting the disk metrics.  Only enable these when troubleshooting disk performance and do not leave enabled.

Enabling Disk Performance Counters

  1. Ensure Task Manager is closed.
  2. Launch the Command Prompt using the “Run as Administrator” option.
  3. Enter the following at the Command Prompt:

    diskperf -Y

  4.  Hit Enter.
  5. Close the Command Prompt.
  6. Re-open the Task Manager.

After running the diskperf command, the ability to view Disk performance statistics on the performance tab should now be visible.

Enable or Disable smb1protocol using PowerShell

Windows Server 2012 R2 & 2016: PowerShell methods

SMB v1
Detect:Get-WindowsFeature FS-SMB1
Disable:Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Enable:Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol
SMB v2/v3
Detect:Get-SmbServerConfiguration | Select EnableSMB2Protocol
Disable:Set-SmbServerConfiguration -EnableSMB2Protocol $false
Enable:Set-SmbServerConfiguration -EnableSMB2Protocol $true

Windows 8.1 and Windows 10: PowerShell methods

SMB v1 Protocol
Detect:Get-WindowsOptionalFeature –Online –FeatureName SMB1Protocol
Disable:Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
Enable:Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
SMB v2/v3 Protocol
Detect:Get-SmbServerConfiguration | Select EnableSMB2Protocol
Disable:Set-SmbServerConfiguration –EnableSMB2Protocol $false
Enable:Set-SmbServerConfiguration –EnableSMB2Protocol $true

Windows 8 and Windows Server 2012

SMB v1 on SMB Server
Detect:Get-SmbServerConfiguration | Select EnableSMB1Protocol
Disable:Set-SmbServerConfiguration -EnableSMB1Protocol $false
Enable:Set-SmbServerConfiguration -EnableSMB1Protocol $true
SMB v2/v3 on SMB Server
Detect:Get-SmbServerConfiguration | Select EnableSMB2Protocol
Disable:Set-SmbServerConfiguration -EnableSMB2Protocol $false
Enable:Set-SmbServerConfiguration -EnableSMB2Protocol $true

Source: https://support.microsoft.com/en-us/help/2696547/how-to-detect-enable-and-disable-smbv1-smbv2-and-smbv3-in-windows-and

Remove Windows Defender from Server 2016

I have my own security software I use on Windows Server operating systems and take out Windows Defender.  Normally, I can do this through Feature removal, but the option to remove Windows Defender was unable to be removed from the manager.

width=678

To remove, I used Powershell.

Remove-WindowsFeature Windows-Defender, Windows-Defender-GUI

width=655