How to disable the user configuration portion of a GPO

Turn off User or Computer settings of a GPO

Finding a way to disable either the user or computer settings of a GPO alone without disabling the entire GPO is easier said than done. However, the PowerShell script like the below can help to do so easily.
 
Provide the Fully Qualified Domain Name and GUID of GPO as parameters and run the script as is to enable computer settings and disable user settings. If you want to disable computer settings and enable user settings edit the script by replacing "$objGpo.SetComputerEnabled($true)$objGpo.SetUserEnabled($false)"
with "$objGpo.SetComputerEnabled($false)$objGpo.SetUserEnabled($true)" and execute.

Script

<#
.SYNOPSIS
This script can be used to enable computer settings and disable user settings of a GPO.
.DESCRIPTION
This script can be used to enable computer settings and disable user settings of a GPO.
.EXAMPLE
C:\PS> C:\Script\Turn_Off_User_Or_Computer_Settings.ps1 mslync10.com 31B2F340-016D-11D2-945F-00C04FB984F9
Enables computer settings and disables user settings of a DefaultDomainPolicy.
#>

param( [String]$Domain_FQDN , [String]$GPO_GUID )
$gpm = New-Object -ComObject GPMgmt.GPM
#Creates and returns a GPMConstants object that allows you to retrieve the value of multiple Group Policy Management Console (GPMC) constants.

$gpmConstants = $gpm.GetConstants()
$objDomain = $gpm.GetDomain(“$Domain_FQDN”, “”, $gpmConstants.UseAnyDC)
#Identify the GPO uniquely by using its GUID.

$objGpo = $objDomain.GetGPO(“{$GPO_GUID}”)
#set true to enable and false to disabe the user or computer settings.

$objGpo.SetComputerEnabled($true)
$objGpo.SetUserEnabled($false)