locked
DSC Configuration to disable Visual Effects RRS feed

  • Question

  • I am trying to optimize the Windows OS by disabling the Visual effects. Well setting Visual Effects value to 'adjust to best performance' to be exact. I am using the following Configuration Script:


       

    Configuration OSConfig   

    {    param   

    (   

    [parameter()]   

    [string]   

    $NodeName = 'localhost'   

    )       

    # It is best practice to always directly import resources, even if the resource is a built-in resource.       

    Import-DSCResource -Name WindowsClient   

    Import-DscResource -Name Registry       

    Node $NodeName   

    {    # The name of this resource block, can be anything you choose, as long as it is of type [String] as indicated by the schema.   

    Registry VisualEffects   

    {   

    Ensure = "Present"       

    Key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects"       

    ValueName = "VisualFXSetting"       

    ValueData = "2"       

    ValueType = "Dword"       

    }   

    }       

    }




    What i Expects this to do is, it should create a VisualFXSetting property under the Visual Effects Key and set its value to 2. But this is not happening after i run the Start-DscConfiguration Command. Is this the way to do it?

    • Edited by Harshitha R Thursday, March 7, 2019 10:12 AM
    • Moved by Bill_Stewart Wednesday, September 4, 2019 6:21 PM This is not PowerShell DSC training forum
    Thursday, March 7, 2019 10:10 AM

All replies

  • Please go through the below link:

    https://msfn.org/board/topic/31999-adjust-for-best-performance-through-command-line/

    Please remember to mark the replies as answers if they help.

    Thursday, March 7, 2019 10:15 AM
  • @Shumanyu Goel I dont want to achieve this through command line. I want to apply this configuration particularly through Powershell DSC configuration.

     
    • Edited by Harshitha R Thursday, March 7, 2019 10:31 AM
    Thursday, March 7, 2019 10:30 AM
  • Hi Harshitha,

    For PS, Please go through the below link:

    https://stackoverflow.com/questions/55019693/visual-effects-set-to-adjust-for-best-performance-using-powershell-dsc

    Please remember to mark the replies as answers if they help.

    Thursday, March 7, 2019 10:38 AM
  • @Shumanyu Goel, the link contains the powershell script. I already have that. what i want is powershell DSC Configuration as i have mentioned in my original question.
    Thursday, March 7, 2019 11:03 AM
  • Hi Harshitha,

    For PS, Please go through the below link:

    https://stackoverflow.com/questions/55019693/visual-effects-set-to-adjust-for-best-performance-using-powershell-dsc

    Please remember to mark the replies as answers if they help.

    DSC is a subsystem of WMF.  It is used to broadcast configurations and enforcement to all systems in a network.  A standard PwoerSHell script cannot do this.

    Please take some time to learn a bit about DSC, what it is and what it does.


    \_(ツ)_/

    Thursday, March 7, 2019 11:07 AM
  • @Shumanyu Goel, the link contains the powershell script. I already have that. what i want is powershell DSC Configuration as i have mentioned in my original question.

    What errors are you getting.

    Here is a better copy of your config.

    Configuration OSConfig {
        param(
            [parameter()]
            [string]$NodeName = 'localhost'
        )
        #Import-DSCResource -Name WindowsClient
        Import-DscResource -Name Registry
        
        Node $NodeName{
            Registry VisualEffects{
                Ensure = "Present"
                Key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects"
                ValueName = "VisualFXSetting"
                ValueData = "2"
                ValueType = "Dword"
            }
        }
    }
    
    

    You have failed to tell us how you compiled your configuration.


    \_(ツ)_/

    Thursday, March 7, 2019 11:09 AM
  • I am using this command to compile:

    . .\OSOptimazationConfig.ps1.

    I am not getting any erros as such. even registry key value is updating its value to 2 as i want after i run the start-dscconfiguartion. But in the GUI(Under Advance System Properties -> Visual effects) its still showing as "let computer choose what's best for you" and not "adjust for best performance". It should ideally change to "adjust for best performance". Any thoughts on this?


    • Edited by Harshitha R Thursday, March 7, 2019 11:16 AM
    Thursday, March 7, 2019 11:15 AM
  • What is that script.  It is NOT a command.  It is a script file.


    \_(ツ)_/

    Thursday, March 7, 2019 11:17 AM
  • Yeah i am somewhat familiar on why DSC is used. Also learning DSC Concepts and its implementation. As part of that i wanted to achieve this simple task of disabling visual effects and apply it as a configuartion. I doing this for learning and testing purpose.
    Thursday, March 7, 2019 11:18 AM
  • I am using this command to compile:

    . .\OSOptimazationConfig.ps1.

    and to generate the mof i am running this

    OSConfig

    My understanding is , this is the way to compile a config file and generate a mof file.


    • Edited by Harshitha R Thursday, March 7, 2019 11:22 AM
    Thursday, March 7, 2019 11:22 AM
  • Yeah i am somewhat familiar on why DSC is used. Also learning DSC Concepts and its implementation. As part of that i wanted to achieve this simple task of disabling visual effects and apply it as a configuartion. I doing this for learning and testing purpose.

    Before you try to learn DSc it is critical that you learn PowerShell in depth.

    Start here: https://mva.microsoft.com/en-us/training-courses/getting-started-with-microsoft-powershell-8276?l=r54IrOWy_2304984382

    This will give you a framework that includes DSC. After the tutorial you will be better able to proceed with DSC, Wofflow and other subsystems of Windows and PowerShell.


    \_(ツ)_/

    Thursday, March 7, 2019 11:25 AM