IObjectSecurity Method: SetSecurityOnRegistryKey

SetSecurityOnRegistryKey
(
 RegistryKey As String,
[Machine] As Variant
);

Parameters

[in] String RegistryKey
Complete path of the RegistryKey on which security is to be set.

Description
Stamps the security permissions of the current registry key on the registry key specified by the RegistryKey parameter.

Remarks
This method may be used to replicate security permissions of an attached registry key on multiple registry keys.

Example

Dim ObjSec As IObjectSecurity
Dim strRegKeyPath1  As String
Dim strRegKeyPath2  As String
strRegKeyPath1 = "HKEY_LOCAL_MACHINE\SOFTWARE\SOURCE"
strRegKeyPath2 = "HKEY_LOCAL_MACHINE\SOFTWARE\DESTINATION"
Set ObjSec = CreateObject("DirectScript.ObjectSecurity")
'Read the security of the Source registry key
ObjSec.AttachRegistryKey strRegKeyPath1, "MachineName", True
'Stamp or write the security of the currently attached registrykey
'to the destination key.
ObjSec.SetSecurityOnRegistryKey strRegKeyPath2, "MachineName"

 

See Also

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.