![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Creating Event Logs Exception I have created a custom eventlog using powershell using the following script $eventSourceCreationData = new-object System.Diagnostics.EventSourceCreationData($source, $logName); [System.Diagnostics.EventLog]::CreateEventSource($eventSourceCreationData); Problem arrises when I browse to the registry key for the eventlog and select permissions. I get the following error "Permissions on "LogName" are incorrectly ordered, which may cause some entries to be ineffective. Also if I try to set the permissions from script usng the following script $location = 'REGISTRY::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\{0}' -f $logName; $registryRights = [System.Security.AccessControl.RegistryRights]::QueryValues -bor [System.Security.AccessControl.RegistryRights]::EnumerateSubKeys -bor [System.Security.AccessControl.RegistryRights]::Notify -bor [System.Security.AccessControl.RegistryRights]::ReadKey; $inheritanceFlags = [System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [System.Security.AccessControl.InheritanceFlags]::ObjectInherit; $propagationFlags = [System.Security.AccessControl.PropagationFlags]::None; $accessControlType = [System.Security.AccessControl.AccessControlType]::Allow; $registryAccessRule = New-Object System.Security.AccessControl.RegistryAccessRule( $identityReference, $registryRights, $inheritanceFlags, $propagationFlags, $accessControlType); # Get acl for event log registry key location $acl = Get-Acl $location # Create access rule and set in acl $acl.SetAccessRule($registryAccessRule); # Apply new acl settings to location $acl | Set-Acl $location I get the following exception Exception calling "SetAccessRule" with "1" argument(s): "This access control list is not in canonical form and therefore cannot be modified." Any help or suggestions would be much appreciated. David |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Creating Event Logs Exception You can get the exisiting ACL from another log and apply it to yours: $acl = get-acl HKLM:\SYSTEM\CurrentControlSet\Services\Eventlog\Application set-acl HKLM:\SYSTEM\CurrentControlSet\Services\Eventlog\LogName -aclobject $acl ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > I have created a custom eventlog using powershell using the following > script $eventSourceCreationData = new-object > System.Diagnostics.EventSourceCreationData($source, $logName); > [System.Diagnostics.EventLog]::CreateEventSource($eventSourceCreationD > ata); Problem arrises when I browse to the registry key for the > eventlog and select permissions. I get the following error > "Permissions on "LogName" are incorrectly ordered, which may cause > some entries to be ineffective. > > Also if I try to set the permissions from script usng the following > script > $location = > 'REGISTRY::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventl > og\{0}' > -f $logName; > $registryRights = > [System.Security.AccessControl.RegistryRights]::QueryValues -bor > [System.Security.AccessControl.RegistryRights]::EnumerateSubKeys -bor > [System.Security.AccessControl.RegistryRights]::Notify -bor > [System.Security.AccessControl.RegistryRights]::ReadKey; > $inheritanceFlags = > [System.Security.AccessControl.InheritanceFlags]::ContainerInherit > -bor > [System.Security.AccessControl.InheritanceFlags]::ObjectInherit; > $propagationFlags = > [System.Security.AccessControl.PropagationFlags]::None; > $accessControlType = > [System.Security.AccessControl.AccessControlType]::Allow; > $registryAccessRule = New-Object > System.Security.AccessControl.RegistryAccessRule( > $identityReference, > $registryRights, > $inheritanceFlags, > $propagationFlags, > $accessControlType); > # Get acl for event log registry key location > $acl = Get-Acl $location > # Create access rule and set in acl > $acl.SetAccessRule($registryAccessRule); > # Apply new acl settings to location > $acl | Set-Acl $location > I get the following exception > > Exception calling "SetAccessRule" with "1" argument(s): "This access > control list is not in canonical form and therefore cannot be > modified." > > Any help or suggestions would be much appreciated. > > David > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| archiving event logs | VB Script | |||
| Managing Event Logs | Software | |||
| subject windows Vista Event Logs access through WMI ( Applications and Services Logs) | Vista networking & sharing | |||
| windows Vista Event Logs access through WMI ( Applications and Services Logs) | Vista General | |||
| Event logs | Vista General | |||