Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I create a custom .adm template to edit more than one key value at once?

Posted on 2009-04-22
3
Medium Priority
?
1,895 Views
Last Modified: 2012-05-06
To set the default server for an application I need to add the following into registry via group policy:

[HKEY_LOCAL_MACHINE\SOFTWARE\OTG\EmailXtender\exSearch\cfgServers\winexp01.au.thlgroup.local]
"IsDefault"=dword:00000001
"TypeE5"=dword:00000000

Also need the policy to modify any existing entry in this key to the following:

[HKEY_LOCAL_MACHINE\SOFTWARE\OTG\EmailXtender\exSearch\cfgServers\emailxtender.internal.local]
"IsDefault"=dword:00000000
"TypeE5"=dword:00000000

Below is the code for an .adm template I created but it won't load.
Gives the error:

The following error occured in
<policy>.ADM on line 10
Error 51 Unexpected keyword
Found: VALUEON
Expected: KEYNAME, VALUENAME, MIN, MAX, SPIN, DEFAULT, REQUIRED, TXTCONVERT, SOFT, END, CLIENTEXT
The file can not be loaded.
 

 


CLASS MACHINE
 
CATEGORY "EmailXtender"
 
 POLICY "RemoveDefault"
  KEYNAME "SOFTWARE\OTG\EmailXtender\exSearch\cfgServers\emailxtender.au.thlgroup.local"
  PART "TypeE5"
   NUMERIC 
   VALUENAME "TypeE5"
   VALUEON NUMERIC 0
   VALUEOFF NUMERIC 0
  END PART
 
  PART "IsDefault"
   NUMERIC 
   VALUENAME "IsDefault"
   VALUEON NUMERIC 0
   VALUEOFF NUMERIC 0
  END PART
 END POLICY
 
 
 
 POLICY "SetDefault"
  KEYNAME "SOFTWARE\OTG\EmailXtender\exSearch\cfgServers\winexp01.au.thlgroup.local"
  PART "TypeE5"
   NUMERIC 
   VALUENAME "TypeE5"
   VALUEON NUMERIC 0
   VALUEOFF NUMERIC 0
  END PART
 
  PART "IsDefault"
   NUMERIC 
   VALUENAME "IsDefault"
   VALUEON NUMERIC 1
   VALUEOFF NUMERIC 0
  END PART
 END POLICY
 
END CATEGORY

Open in new window

0
Comment
Question by:Axonites
2 Comments
 
LVL 6

Accepted Solution

by:
mvgeertruyen earned 1000 total points
ID: 24213964
There are a number of syntax errors in here - mainly the use of numeric instead of checkbox.
Note that you can only use keys SOFTWARE\Policies and SOFTWARE\Microsoft - not SOFTWARE\OTG...
http://support.microsoft.com/kb/323639
CLASS MACHINE
 
CATEGORY "EmailXtender"
 POLICY "RemoveDefault"
  KEYNAME SOFTWARE\Policies\OTG\EmailXtender\exSearch\cfgServers\emailxtender.au.thlgroup.local
  PART "TypeE5" CHECKBOX
   VALUENAME TypeE5
   VALUEON NUMERIC 1
   VALUEOFF NUMERIC 0
  END PART
 END POLICY
 
END CATEGORY

Open in new window

0
 
LVL 7

Assisted Solution

by:sfarazmand
sfarazmand earned 1000 total points
ID: 24280810
Creating an Admin Template can be fairly simple in your case.

What you need to do is export the registry settings from a machine that is configured properly.

If you only need those settings I would export from HKEY_LOCAL_MACHINE\SOFTWARE\OTG\EmailXtender\exSearch\cfgServers

once exported you can use reg2adm (http://www.novell.com/coolsolutions/tools/downloads/reg2adm.zip) to convert the reg file into an adm file.

Note: If you use multiple registry settings (.reg) open them up and copy the settings in one file. Do not copy the versioninformation at the top (Windows Registry Editor Version 5.00)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question