|
The Client network configuration for SQL Server can be
found in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\.
For this example I will create policy entries for the network library, the
"AutoANSIToOEM" option and the "Use international settings" option.
The Policy Template file (a normal text file) starts by specifying the relevant Section
in the Registry. As these settings are machine related, the Class will be
Machine:
For this class we create a new category called SQL Server.
The exact string is specified a bit further down in the file (in the [strings]
section).
To be open for further amendments I include another
subcategory call DBLibrary.
Now the Policies can be defined. The first policy will
allow you to select a network library.
The keyname specifies where the values are stored in the
registry.
KEYNAME
SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo |
The value for the network library will be stored under
DSQUERY. The default value is Windows Sockets.
ACTIONLISTOFF
VALUENAME "DSQUERY" VALUE !!DBMSSOCN
END ACTIONLISTOFF |
For this value a dropdown list is created. The entries
define all possible Network libraries that exist. Just delete the entries you do
not intend to use.
PART
!!DSQUERY DROPDOWNLIST REQUIRED
VALUENAME "DSQUERY"
ITEMLIST
; Named Pipes
NAME !!DSNAMEDPIPE VALUE !!DBNMPNTW
; Windows Sockets
NAME !!DSSOCKETS VALUE !!DBMSSOCN
; Multiprotocol
NAME !!DSMULTI VALUE !!DBMSRPCN
; NWLink SPX/IPX
NAME !!DSNWLINK VALUE !!DBMSSPXN
; Apple Talk
NAME !!DSAPPLE VALUE !!DBMSADSN
; Banyan Vines
NAME !!DSBANYAN VALUE !!DBMSVINN
END ITEMLIST
END PART
END POLICY
|
So that is the end of the first policy. In policy editor (POLEDIT.EXE)
it will now look like this:

The following lines show, how the settings for
AutoAnsiToOEM setting and the "Use international settings" can
be set.
KEYNAME
"SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib"
POLICY !!DBLIBOPTIONS
VALUENAME "AutoANSIToOEM"
VALUEON "ON"
VALUEOFF "OFF"
PART !!AUTOAnsi_Tip1 TEXT END PART
PART !!AUTOAnsi_Tip2 TEXT END PART
END POLICY
POLICY !!DBLIBOPTIONS2
VALUENAME "UseIntlSettings"
VALUEON "ON"
VALUEOFF "OFF"
PART !!INTLSett_Tip1 TEXT END PART
PART !!INTLSett_Tip2 TEXT END PART
END POLICY
END CATEGORY
END CATEGORY ; SQLSERVER
|
These lines define the values for checkboxes. For SQL
Server the values ON and OFF are used.
The last thing missing is the strings
section. Here all the strings used in the policy file are defined.
[strings]
SQLServer="Microsoft SQL Server"
Client="Client-Settings"
NetworkLibrary="Network Library"
DSNAMEDPIPE="Named Pipes"
DSSOCKETS="Windows Sockets"
DSMULTI="Multiprotocol"
DSNWLINK="NWLink IPX/SPX"
DSAPPLE="Apple Talk"
DSBANYAN="Banyan VINES"
DBMSSOCN="DBMSSOCN"
DBNMPNTW="DBNMPNTW"
DBMSRPCN="DBMSRPCN"
DBMSSPXN="DBMSSPXN"
DBMSADSN="DBMSADSN"
DBMSVINN="DBMSVINN"
DSQUERY="Select a Network-Library: "
DBLIBOPTIONS="Auto ANSI to OEM Conversion"
DBLIBOPTIONS2="Use International settings"
DBLibrary="DB Library"
AUTOAnsi_Tip1="Use automatic ANSI to OEM conversion"
AUTOAnsi_Tip2="when connecting to SQL Server"
INTLSett_Tip1="Use international settings"
INTLSett_Tip2="when connection to SQL Server" |
|