Here are some basic code samples to get started:
- Getting all instances using PowerShell:
Get-WMIObject -Class SystemRestore
Get-WMIObject -Class SystemRestore |
Out-GridView
Get-CIMInstance -ClassName SystemRestore |
- Selecting all properties (view full object content):
Get-WMIObject -Class SystemRestore |
Select-Object -Property *
Get-WMIObject -Class SystemRestore |
Select-Object -Property * |
Out-GridView -Title "SystemRestore" |
- Querying information remotely:
$ComputerName = 'SomeServerNameOrIP'
Get-WMIObject -Class SystemRestore -ComputerName $ComputerName
$ComputerName = 'SomeServerNameOrIP'
$Username = 'mydomain\\myusername'
Get-WMIObject -Class SystemRestore -ComputerName $ComputerName -Credential $Username |
Most WMI properties are read-only. You can only read values but no change them. Few properties are also writeable. You can assign new values to those properties.
Writeable properties are marked with this icon:
Data type UInt32
Data type UInt32
Data type UInt32
Data type String
Data type String
The CreateRestorePoint method creates a restore point.It returns a COM error code.
View full documentation.
The Disable method disables SR on a drive.It returns a COM error code.
View full documentation.
The Enable method enables SR on a drive.It returns a COM error code.
View full documentation.
Returns the status (0=fail, 1=success, 2=interrupted) of the last restore.
View full documentation.
The Restore method restores the system to a specified restore point.It returns a COM error code.
View full documentation.
You have a question about WMI in general or this particular WMI Class? Then please visit our free forum: Help me with WMI. There are even more forums to assist you, so you may want to look at the full forum list to pick the best one.
Please use the comment form below to actively submit new content for this page. So if you found an error or have sample code showing this class in action, please share by using the comment form on the bottom of this page.
Community Content
You are cordially invited to add knowledge to this page. If you have sample code or additional information related to this WMI class, please share it. Use the comment form to send your information. We will edit and incorparate it into the reference library. Thank you!
Please do not use the comment form to submit questions. If you have questions or need assistance, visit our free forum: Help me with WMI.