Domanda

I am a system admin for a small heating company, one of the requirements in the meeting the other day was that we take a backup of c:\windows\system32\config for every machine on the network (49) including mine.

Due to the directory being locked (rightly so) I don't seem to have access to these files. Even as domain admin.

Is there any way around this? Maybe through the registry?

The old c:\windows\repair folder seems have to have gone in Windows 7 SP1, this is how I thought I was going to do it.

I have suggested a full backup image (Acronis True Image I put forward) of the machine but we just don't have the space requirement or time at the moment to backup every machine (we use about 13 different vendor machines) so creating an image for each will also be a pain. so fixing machines when they break is our only hope really and this happens often and usually results in a complete rebuild. Having the system files would allow us to fix minor window errors rather than rebuilding the whole machine.

Unless someone has some other suggestion?

I am creating the program in c# as its one of the only languages I sort of know and am learning. I plan to make it a startup script in the global policy so we get a backup of the files everytime someone logs in.

Manifest shows

<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />

Source Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace ConsoleApplication3
{
 class Program
 {
    static void Main(string[] args)
    {

        /// Get DEFAULT
        File.Copy(@"C:\Windows\System32\config\DEFAULT", @"C:\DEFAULT");
        /// Then FTP/COPY TO NAS
        /// SOURCE CODE HERE
    }
 }
}

Added my source code, error I am getting is

+       $exception  {"Could not find    file'C:\\Windows\\System32\\config\\DEFAULT'.":"C:\\Windows\\System32\\config\\DEFAULT"} System.Exception {System.IO.FileNotFoundException}

http://i.imgur.com/94pEa1M.png

È stato utile?

Soluzione

You can't copy content of this folder from running system, even with full local/domain administrator rigths. Access to content of this folder is highly restricted because it contains most vulnerable and secured datafiles in Windows OS - system registry, stored password vault, SAM-database, internal kernel and security logs. They always open by system with explit read/write permission without any shared-access rights. Also access to them restricted inside kernel filesystem drivers.

There is no any legal and offical documented way to copy them. What you trying to do is posible illegal too... Just don't copy them.

Altri suggerimenti

You have to run your application as administrator. There is no other way.

You can force that by changing the application manifest. There is already a good answer for that: How do I force my .NET application to run as administrator?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top