PDA

View Full Version : Importing Group Policy or Registry setting in Text



nagrawal
07-10-2001, 02:33 PM
How Can I import the Group Policy on a local computer to a excel file (or a text file) . I want to prepare a document which will list the original setting and modified setting side by side for for future reference.

RWSchlatter
07-10-2001, 08:55 PM
use Regedit.exe in command line mode from the DOS prompt and export to a text file.

check the Registry Guide, Registry FAQ, especially the following page:
http://www.winguides.com/article.php?id=1&page=4&guide=registry (http://www.winguides.com/external.php?url=http://www.winguides.com/article.php?id=1&page=4&guide=registry)

______________
Regards - Richard

MJones
07-11-2001, 01:25 PM
If I've undrstood the question, this may help?

"Regedit /e c:\test.txt hkey_current_user\software\microsoft\windows\curre ntversion\policies"

RWSchlatter
07-11-2001, 06:33 PM
Hi Nilesh !

from your private mail with an attachment

Sorry for the improper wording of previous mail. What I want is Group Policy (Local security setting) on one computer to be imported in a excel sheet.

Have a look at the attachment ... below. This file contains all the settings in group policy. These are default settings. I have modified most of these settings so as to achive a workstation which suits my requirement.

Now I want these modified settings to be documented against the default settings in ...XLS file. One way is to open the computer management tool in MMC and manually note down all the changes. I am wondering if I can automate the activity and import the setting in a excel sheet?

"...What I want is Group Policy (Local security setting) on one computer to be imported in a excel sheet...."

J still believe J gave you the proper answer to this, but let me give you some further advice.
Your actual problem: What you are missing is a key to match the registry data to your speadsheet.
My suggestion: Add the required registry keys to the detail lines of your spread sheet. You can either hide the columns or put them to the far right, so that they don't disturb.

Once you have this information, there will be some need for a bit programming. Either use VBA from within your spreadsheet, or write some WSH scripts (possibly using VBS, cause that's near to VBA), or write some small command line pplication in Visual Basic (or whatever language is available to you).

How to find the registry keys and value names:

go to directory x:\<windows>\System32\ADM and make a copy of the *.adm files to your own working directory.

Have a look and study the structure.

With a quick-and-dirty approach, using either an editor or some small programm, remove anything from the file except lines with words POLICY, KEYNAME and VALUENAME. Each of these items will have either a string identifier in the form of !!<stringname> (for POLICY) or an actual string within quotes. Create a delimited file with the data of these three items and read it into some columns of your spreadsheet.

At the end of the *.adm files, following a section header of "[strings]", the string values for !!<stringname> are listed, separate name and string values and put into a delimited file, again import into separate columns of your spreadsheet.

You now have two "databases" in the sense of Excel, you can now create some VBA code or macro to do the lookup of displayable Policy name, use the identifier to match with the key and value name table. Once you have a complete match, copy key and value names to two additional columns belonging to the main section of your spreadsheet.

How to aquire the registry data:

From my point of view, you have three choices:

(1) retrieve the values using VBA code from within the spreadsheet. J don't think this is very sensible,as you would have to transport the spreadsheet to the workstation, run the code, and retrieve the spreadsheet again.

(2) Export a file of key and value names from spreadsheet. Send this file to the workstation. Use this information as input into either a WSH script or a small (command line) application executed at the workstation. Read the registry with the given keys and names and write an output file of keyname, valuename and datavalue. Retrieve the resulting file to your own machine and fill into your spreadsheet. Decode the usually numeric value back to the text string you like to have in the already reserved column.

(3) Run a Regedit.exe export at the workstation, as suggested in my original answer. Transport it to your own workstation. Write some VBA code to read this text file, parse the key- and valuenames, and pick the data values. Match this to the names of keys and values and if found, collect the data.

______________
Regards - Richard