Hello, Guyz, today I’m going to create an automated script for enable system protection on “C” drive (C:\) which is the task I have been assigned. Actually running a script via the domain is something critical because all the user machines are affected to the changes whatever the scripts do. So first of all let’s see what are the steps to achieve this goal.
As a condition, I have to configure the scripts for checking system protection is enabled at each logon. So now let’s make a plan.
- What type of script that is possible on this task.
- How to write the script according to the selected type.
- How to run the script on the domain user machines.
These are the basic steps to achieve the goal. let’s get one by one to realize for the task.
What type of script that is possible on this task.
I searched most of the site for enabling system protection via .bat file, .vbs file, .ps1 file. As I realized powershell script was the best way to create a script to handle this because powershell has a inbuilt commands to enable system protection.
How to write the script according to the selected type
When I try to write the script I got a problem, how to check whether the system protection is already enable or not. So I found a solution to overcome this problem which is actually bat script. In that bat script it is looking for that the particular registry value is “0” or “1”(HKEY_LOCAL_MACHINE-> SOFTWARE-> Microsoft-> Windows NT-> CurrentVersion-> SystemRestore ).