Category Archives: Disable

Disable-PSRemoting

NAME
    Disable-PSRemoting

SYNOPSIS
    Prevents the computer from receiving remote Windows PowerShell commands.

SYNTAX
    Disable-PSRemoting [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Disable-PSRemoting Function disables all session configurations on the local computer by adding a “deny all” entry to their security descriptors. This prevents the local computer from receiving remote commands.

    Disable-PSRemoting does not stop the WinRM service and it does not prevent users of the local computer from establishing sessions that connect to remote computers or sending commands to other computers.

    To re-enable the session configurations, use the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlets.

    To run this Function on Windows Vista, Windows Server 2008, and later versions of Windows, you must open Windows PowerShell with the “Run as administrator” option.

PARAMETERS
    -Force [<SwitchParameter>]
        Suppresses all user prompts. By default, you are prompted to confirm each operation.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    None
        You cannot pipe input to this cmdlet.

OUTPUTS
    None
        This cmdlet does not return any object.

NOTES

        A session configuration is a group of settings that define the Environment for a session. The session configurations are located on the remote computer and are used by local and remote sessions that connect to the computer.

        Every session that connects to the computer must use one of the session configurations that are registered on the computer. This includes persistent sessions that you create by using New-PSSession or Enter-PSSession cmdlets, and the temporary sessions that Windows PowerShell creates when you use the ComputerName parameter of a cmdlet that uses WS-Management remoting technology, such as Invoke-Command. By denying access to all session configurations, you effectively prevent all users from establishing sessions that connect to the computer.

        Disable-PSRemoting is the equivalent of “Disable-PSSessionConfiguration -name *.

    ————————– EXAMPLE 1 ————————–

    C:\PS>disable-psremoting

    Description
    ———–
    This command disables all session configurations on the computer.

    ————————– EXAMPLE 2 ————————–

    C:\PS>disable-psremoting -force

    Description
    ———–
    This command disables all session configurations on the computer without prompting.

    ————————– EXAMPLE 3 ————————–

    C:\PS>disable-psremoting -force

    C:\PS> New-PSSession -computername localhost

    [localhost] Connecting to remote server failed with the following error
    message : Access is denied. For more information, see the about_remote_Troub
    leshooting Help topic.
        + CategoryInfo         : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionOpenFailed

    C:\PS> New-PSSession -computername Server01

     Id Name     ComputerName    State    Configuration         Availability
     — —-     ————    —–    ————-         ————
     1 Session1 Server01…     Opened Microsoft.PowerShell     Available

    C:\PS> Enable-PSSessionConfiguration -name * -force

    C:\PS> New-PSSession -computername localhost

     Id Name     ComputerName    State    Configuration         Availability
     — —-     ————    —–    ————-         ————
     1 Session1 localhost     Opened Microsoft.PowerShell     Available

    Description
    ———–
    This example shows the effect of using Disable-PSRemoting.

    The first command uses Disable-PSRemoting to disable all registered session configurations on the local computer.

    The second command uses the New-PSSession to create a remote session to the local computer (also known as a “loopback”). Because the session configurations that session requires are disabled, the command fails.

    The third command uses the New-PSSession cmdlet to create a session from the local computer to the Server01 remote computer. This command, which uses the session configurations on the remote computer, succeeds.

    The fourth command uses the Enable-PSSessionConfiguration cmdlet to re-enable all of the session configurations on the local computer. The command uses a value of * (all) in the Name parameter.

    The fifth command attempts again to establish a loopback session by using the New-PSSession cmdlet. This time the command succeeds, because the session configuration that requires are enabled.

    ————————– EXAMPLE 4 ————————–

    C:\PS>disable-psremoting -force

    C:\PS> Get-PSSessionConfiguration | Format-Table -property name, permission -auto

    Name                 Permission
    —-                 ———-
    microsoft.powershell Everyone AccessDenied, BUILTIN\Administrators AccessAllowed
    microsoft.powershell32 Everyone AccessDenied, BUILTIN\Administrators AccessAllowed

    C:\PS> Enable-PSRemoting -force
    WinRM already is set up to receive requests on this machine.
    WinRM already is set up for remote management on this machine.

    C:\PS>> Get-PSSessionConfiguration | ft name, Permission -auto

    Name                 Permission
    —-                 ———-
    microsoft.powershell BUILTIN\Administrators AccessAllowed
    microsoft.powershell32 BUILTIN\Administrators AccessAllowed

    Description
    ———–
    This example shows the effect on the session configurations of using Disable-PSRemoting and Enable-PSRemoting.

    The first command uses the Disable-PSRemoting Function to disable all registered session configurations. The force parameter suppresses all user prompts.

    The second command uses the Get-PSSessionConfiguration cmdlet to display the registered session configurations on the computer. The command uses a pipeline operator to send the results to a Format-Table command, which displays only the Name and Permission properties of the configurations in a table.

    The resulting table shows that everyone is denied permission to the configurations.

    The third command uses the Enable-PSRemoting cmdlet to re-enable all of the session configurations on the computer. You can also use an “Enable-PSSessionConfiguration -name *” command. The command uses the Force parameter to suppress all user prompts and to restart the WinRM service without prompting.

    The fourth command uses Get-PSSessionConfiguration and Format-Table to display the names and permissions of the session configurations. The results show that members of the Administrators group now have access to the session configurations.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=144298
    Enable-PSRemoting
    Disable-PSSessionConfiguration
    Get-PSSessionConfiguration
    Register-PSSessionConfiguration
    Set-PSSessionConfiguration
    Unregister-PSSessionConfiguration
    WS-Management Provider

Disable-PSBreakpoint

NAME
    Disable-PSBreakpoint

SYNOPSIS
    Disables the breakpoints in the current console.

SYNTAX
    Disable-PSBreakpoint [-Id] <Int32[]> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]

    Disable-PSBreakpoint [-Breakpoint] <Breakpoint[]> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Disable-PSBreakpoint cmdlet disables breakpoints, which assures that they are not hit when the script runs. You can use it to disable all breakpoints, or you can specify breakpoints by submitting breakpoint objects or breakpoint IDs.

    Technically, this cmdlet changes the value of the Enabled property of a breakpoint object to False. To re-enable a breakpoint, use the Enable-PSBreakpoint cmdlet. Breakpoints are enabled by default when you create them by using the Set-PSBreakpoint cmdlet.

    A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script. Disable-PSBreakpoint is one of several cmdlets designed for debugging Windows PowerShell scripts. For more information about the Windows PowerShell debugger, see about_debuggers.

PARAMETERS
    -Breakpoint <Breakpoint[]>
        Specifies the breakpoints to disable. Enter a Variable that contains breakpoint objects or a command that gets breakpoint objects, such as a Get-PSBreakpoint command. You can also pipe breakpoint objects to the Disable-PSBreakpoint cmdlet.

        Required?                    true
        Position?                    1
        Default value                None
        Accept pipeline input?     true (ByValue)
        Accept wildcard characters? false

    -Id <Int32[]>
        Disables the breakpoints with the specified breakpoint IDs. Enter the IDs or a Variable that contains the IDs. You cannot pipe IDs to Disable-PSBreakpoint.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     true (ByPropertyName)
        Accept wildcard characters? false

    -PassThru [<SwitchParameter>]
        Returns an object representing the enabled breakpoints. By default, this cmdlet does not generate any output.

        Required?                    false
        Position?                    named
        Default value                None
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    System.Management.Automation.Breakpoint
        You can pipe a breakpoint object to Disable-PSBreakpoint.

OUTPUTS
    None or System.Management.Automation.Breakpoint
        When you use the PassThru parameter, Disable-PSBreakpoint returns an object that represents the disabled breakpoint. Otherwise, this cmdlet does not generate any output.

NOTES

    ————————– EXAMPLE 1 ————————–

    C:\PS>$b = Set-PSBreakpoint -script sample.ps1 -variable name

    C:\PS> $b | Disable-PSBreakpoint

    Description
    ———–
    These commands disable a newly-created breakpoint.

    The first command uses the Set-PSBreakpoint cmdlet to create a breakpoint on the Name Variable in the Sample.ps1 script. Then, it saves the breakpoint object in the $b Variable.

    The second command uses the Disable-PSBreakpoint cmdlet to disable the new breakpoint. It uses a pipeline operator (|) to send the breakpoint object in $b to the Disable-PSBreakpoint cmdlet.

    As a result of this command, the value of the Enabled property of the breakpoint object in $b is False.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Disable-PSBreakpoint -id 0

    Description
    ———–
    This command disables the breakpoint with breakpoint ID 0.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Disable-PSBreakpoint -Breakpoint ($b = Set-PSBreakpoint -script sample.ps1 -line 5)

    C:\PS> $b

    Description
    ———–
    This command creates a new breakpoint that is disabled until you enable it.

    It uses the Disable-PSBreakpoint cmdlet to disable the breakpoint. The value of the Breakpoint parameter is a Set-PSBreakpoint command that sets a new breakpoint, generates a breakpoint object, and saves the object in the $b Variable.

    Cmdlet parameters that take objects as their values can accept a Variable that contains the object or a command that gets or generates the object. In this case, because Set-PSBreakpoint generates a breakpoint object, it can be used as the value of the Breakpoint parameter.

    The second command displays the breakpoint object in the value of the $b Variable.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-PSBreakpoint | Disable-PSBreakpoint

    Description
    ———–
    This command disables all breakpoints in the current console. You can abbreviate this command as: “gbp | dbp”.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=113294
    about_debuggers
    Set-PSBreakpoint
    Get-PSBreakpoint
    Enable-PSBreakpoint
    Remove-PSBreakpoint
    Get-PSCallStack

Disable-PSSessionConfiguration

NAME
    Disable-PSSessionConfiguration

SYNOPSIS
    Denies access to the session configurations on the local computer.

SYNTAX
    Disable-PSSessionConfiguration [[-Name] <string[]>] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Disable-PSSessionConfiguration cmdlet prevents all users of the computer from using the session configuration in a session. This is an advanced cmdlet that is designed to be used by system administrators to manage customized session configurations for their users.

    The Disable-PSSessionConfiguration cmdlet adds a “deny all” setting to the security descriptor of one or more registered session configurations. As a result, you can unregister, view, and change the configurations, but you cannot use them in a session.

    Without parameters, Disable-PSSessionConfiguration disables the Microsoft.PowerShell configuration, which is the default configuration that is used for sessions. Unless the user specifies a different configuration, both local and remote users are effectively prevented from creating any sessions that connect to the computer.

    To disable all session configurations on the computer, use Disable-PSRemoting.

PARAMETERS
    -Force [<SwitchParameter>]
        Suppresses all user prompts. By default, you are prompted to confirm each operation.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Name <string[]>
        Specifies the names of session configurations to disable. Enter one or more configuration names. Wildcards are permitted. You can also pipe a string that contains a configuration name or a session configuration object to Disable-PSSessionConfiguration.

        If you omit this parameter, Disable-PSSessionConfiguration disables the Microsoft.PowerShell session configuration.

        Required?                    false
        Position?                    1
        Default value                Microsoft.PowerShell
        Accept pipeline input?     true (ByValue, ByPropertyName)
        Accept wildcard characters? true

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration, System.String
        You can pipe a session configuration object or a string that contains the name of a session configuration to Disable-PSSessionConfiguration.

OUTPUTS
    None
        This cmdlet does not return any objects.

NOTES

        To run this cmdlet on Windows Vista, Windows Server 2008, and later versions of Windows, you must start Windows PowerShell with the “Run as administrator” option.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Disable-PSSessionConfiguration

    Description
    ———–
    This command disables the Microsoft.PowerShell session configuration.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Disable-PSSessionConfiguration -Name *

    Description
    ———–
    This command disables all registered session configurations on the computer.

    ————————– EXAMPLE 3 ————————–

    C:\PS>Disable-PSSessionConfiguration -Name Microsoft* -Force

    Description
    ———–
    This command disables all session configurations that have names that begin with “Microsoft”. The command uses the Force parameter to suppress all user prompts from the command.

    ————————– EXAMPLE 4 ————————–

    C:\PS>Get-PSSessionConfiguration -Name MaintenanceShell, AdminShell | Disable-PSSessionConfiguration

    Description
    ———–
    This command disables the MaintenanceShell and AdminShell session configurations.

    The command uses a pipeline operator (|) to send the results of a Get-PSSessionConfiguration command to Disable-PSSessionConfiguration.

    ————————– EXAMPLE 5 ————————–

    C:\PS>Get-PSSessionConfiguration | Format-Table -property Name, Permission -auto

    Name                 Permission
    —-                 ———-
    MaintenanceShell     BUILTIN\Administrators AccessAllowed
    microsoft.powershell BUILTIN\Administrators AccessAllowed
    microsoft.powershell32 BUILTIN\Administrators AccessAllowed

    C:\PS> Disable-PSSessionConfiguration -Name MaintenanceShell -Force

    C:\PS> Get-PSSessionConfiguration | Format-Table -property Name, Permission -auto

    Name                 Permission
    —-                 ———-
    MaintenanceShell     Everyone AccessDenied, BUILTIN\Administrators AccessAllowed
    microsoft.powershell BUILTIN\Administrators AccessAllowed
    microsoft.powershell32 BUILTIN\Administrators AccessAllowed

    C:\PS> Set-PSSessionConfiguration -Name MaintenanceShell -MaximumReceivedDataSizePerCommandMB 60

    ParamName            ParamValue
    ———            ———-
    psmaximumreceived… 60

    “Restart WinRM service”
    WinRM service need to be restarted to make the changes effective. Do you want to run the command “Restart-Service winrm”?
    [Y] Yes [N] No [S] Suspend [?] Help (default is “Y”): y

    C:\PS> New-PSSession -computername localhost -configurationName MaintenanceShell

    [localhost] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_remote_Troubl
    eshooting Help topic.
        + CategoryInfo         : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
        + FullyQualifiedErrorId : PSSessionOpenFailed

    Description
    ———–
    This example shows the effect of disabling a session configuration.

    The first command uses the Get-SessionConfiguration and Format-Table cmdlets to display only the Name and Permission properties of the session configuration objects. This table format makes it easier to see the values of the objects. The results show that members of the Administrators group are permitted to use the session configurations.

    The second command uses the Disable-PSSessionConfiguration cmdlet to disable the MaintenanceShell session configuration. The command uses the Force parameter to suppress all user prompts.

    The third command repeats the first command. The results show that you can still get the object that represents the MaintenanceShell session configuration even though everyone is denied access to it. The “AccessDenied” entry takes precedence over all other entries in the security descriptor.

    The fourth command uses the Set-PSSessionConfiguration cmdlet to increase the MaximumDataSizePerCommandMB setting on the MaintenanceShell session configuration to 60. The results show that the command was successful even though everyone is denied access to the configuration.

    The fifth command attempts to use the MaintenanceShell session configuration in a session. It uses the New-PSSession cmdlet to create a new session and the ConfigurationName parameter to specify the MaintenanceShell configuration. The results show that the New-PSSession command fails because the user is denied access to the configuration.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=144299
    about_Session_Configurations
    Enable-PSSessionConfiguration
    Get-PSSessionConfiguration
    Register-PSSessionConfiguration
    Set-PSSessionConfiguration
    Unregister-PSSessionConfiguration
    WS-Management Provider

Disable-WSManCredSSP

NAME
    Disable-WSManCredSSP

SYNOPSIS
    Disables Credential Security Service Provider (CredSSP) authentication on a client computer.

SYNTAX
    Disable-WSManCredSSP [-Role] <string> [<CommonParameters>]

DESCRIPTION
    The Disable-WSManCredSPP cmdlet disables CredSSP authentication on a client or on a server computer. When CredSSP authentication is used, the user’s credentials are passed to a remote computer to be authenticated. This type of authentication is designed for commands that create a remote session from within another remote session. For example, you use this type of authentication if you want to run a background job on a remote computer.

    The cmdlet is used to disable CredSSP on the client by specifying Client in the Role parameter. The cmdlet then performs the following:

        – Disables CredSSP on the client. The WS-Management setting <localhost|computername>\Client\Auth\CredSSP is set to false.
        – Removes any WSMan/* setting from the Windows CredSSP policy AllowFreshCredentials on the client.

    The cmdlet is used to disable CredSSP on the server by specifying Server in the Role parameter. The cmdlet then performs the following:

     – Disables CredSSP on the server. The WS-Management setting <localhost|computername>\Service\Auth\CredSSP is set to false.

    Caution: CredSSP authentication delegates the user’s credentials from the local computer to a remote computer. This practice increases the security risk of the remote operation. If the remote computer is compromised, when credentials are passed to it, the credentials can be used to control the network session.

    To disable CredSSP authentication, use the Disable-WSManCredSSP cmdlet.

PARAMETERS
    -Role <string>
        Accepts one of two possible values: Client or Server. These values specify whether CredSSP should be disabled as a client or as a server.

        If the cmdlet is used to disable CredSSP on the client by specifying Client in the Role parameter, then the cmdlet performs the following:

            – Disables CredSSP on the client. The WS-Management setting <localhost|computername>\Client\Auth\CredSSP is set to false.
            – Removes any WSMan/* setting from the Windows CredSSP policy AllowFreshCredentials on the client.

        If the cmdlet is used to disable CredSSP on the server by specifying Server in the Role parameter, the cmdlet performs the following:

         – Disables CredSSP on the server. The WS-Management setting <localhost|computername>\Service\Auth\CredSSP is set to false.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    None
        This cmdlet does not accept any input.

OUTPUTS
    None
        This cmdlet does not generate any output.

NOTES

        To enable CredSSP authentication, use the Enable-WSManCredSSP cmdlet.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Disable-WSManCredSSP -Role Client

    Description
    ———–
    This command disables CredSSP on the client, which prevents delegation to servers.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Disable-WSManCredSSP -Role Server

    Description
    ———–
    This command disables CredSSP on the server, which prevents delegation from clients.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkId=141438
    Connect-WSMan
    Disconnect-WSMan
    Enable-WSManCredSSP
    Get-WSManCredSSP
    Get-WSManInstance
    Invoke-WSManAction
    New-WSManInstance
    New-WSManSessionOption
    Remove-WSManInstance
    Set-WSManInstance
    Set-WSManQuickConfig
    Test-WSMan

Disable-ComputerRestore

NAME
    Disable-ComputerRestore

SYNOPSIS
    Disables the System Restore feature on the specified file system drive.

SYNTAX
    Disable-ComputerRestore [-Drive] <string[]> [-Confirm] [-WhatIf] [<CommonParameters>]

DESCRIPTION
    The Disable-ComputerRestore cmdlet turns off the System Restore feature on one or more file system drives. As a result, attempts to restore the computer do not affect the specified drive.

    To disable System Restore on any drive, it must be disabled on the system drive, either first or concurrently.

    To re-enable System Restore, use the Enable-ComputerRestore cmdlet. To find the state of System Restore for each drive, use Rstrui.exe.

PARAMETERS
    -Drive <string[]>
        Specifies the file system drives. Enter one or more file system drive letters, each followed by a colon and a backslash and enclosed in quotation marks, such as “C:\” or “D:\”. This parameter is required.

        You cannot use this cmdlet to disable System Restore on a remote network drive, even if the drive is mapped to the local computer, and you cannot disable System Restore on drives that are not eligible for System Restore, such as external drives.

        To disable System Restore on any drive, System Restore must be disabled on the system drive, either before or concurrently.

        Required?                    true
        Position?                    1
        Default value                None
        Accept pipeline input?     false
        Accept wildcard characters? false

    -Confirm [<SwitchParameter>]
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    -WhatIf [<SwitchParameter>]
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?     false
        Accept wildcard characters? false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        “Get-Help about_CommonParameters“.

INPUTS
    None
        You cannot pipe input to this cmdlet.

OUTPUTS
    None
        This cmdlet does not generate any output.

NOTES

        Disable-ComputerRestore and Enable-ComputerRestore work only on client operating systems, such as Windows Vista and Windows XP.

        To run a Disable-ComputerRestore command on Windows Vista and later versions of Windows, open Windows PowerShell with the “Run as administrator” option.

        To find the file system drives that are eligible for system restore, in System in Control Panel, see the System Protection tab. To open this tab in Windows PowerShell, type “SystemPropertiesProtection”.

        This cmdlet uses the Windows Management Instrumentation (WMI) SystemRestore class.

    ————————– EXAMPLE 1 ————————–

    C:\PS>Disable-ComputerRestore -Drive “C:\”

    Description
    ———–
    This command disables System Restore on the C: drive.

    ————————– EXAMPLE 2 ————————–

    C:\PS>Disable-ComputerRestore “C:\”, “D:\”

    Description
    ———–
    This command disables System Restore on the C: and D: drives. The command uses the Drive parameter, but it the omits the optional parameter name.

RELATED LINKS
    Online version: http://go.microsoft.com/fwlink/?LinkID=135207
    Enable-ComputerRestore
    Get-ComputerRestorePoint
    Restore-Computer
    Restart-Computer