System restore management and creation via command line

alex110109
alex110109 used Ask the Experts™
on
Hi

We need to regularly create system restore points on our user computers via command line.

The idea is to automate this process without deploying any 3rd party tools.

Step 1. Check if system restore is enabled on the computer. If it is not, enable it.
Step 2. Check the storage size allocated for system restore. If it is less than 6 GB, configure to to be 6 GB.
Step 3. Create a system restore point with a generic label e.g. "maintenance".
Step 4. Check if the system restore point got created or not by listing existing system restore points and comparing the labels with the generic label used in step3.


So this is the general idea of the script we want to create and I think I can do the other bits myself except for creating system restore point via command line.

I have tried the WMIC method, powershell method and everything else I can find on blogs and google search.

Most commands I run return the "execution successful" message.

But when I check manually if the system restore point got created or not by opening system restore GUI, I don't see the restore point created.

For the life of me I can't figure out what's going on.

So pls help !
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
2018-11-07_10-35-35.jpg you can only create 1 every 24 hours
Michael B. SmithManaging Consultant

Commented:
What OS?

In Win10 it's trivial: CheckPoint-Computer. Prior to Win10 requires quite a bit of WMI.

Author

Commented:
Hi Guys

The checkpoint-computer should work fine for Windows 10 computers and I think WMIC should be fine for Windows 7 computer but I will test it.

Does anyone know how to list restore points from command line on both 7 and 10?

I want to make that script.
Michael B. SmithManaging Consultant

Commented:
Get-ComputerRestorePoint has worked since Windows 7.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial