How to work with PowerShell to change values of Web.Config file? - powershell

I am working on PowerShell. In that am trying to change the values of an existing config file values with the help of PowerShell and its working well.
But I faced a new task as below and strucked here in converting the values in PowerShell to override in my config file. For this task, I referred this link
If had a Code like this :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="service.tasks" type="HRNetTaskService.TaskConfigurationSection, TaskService" />
</configSections>
<connectionStrings>
<add name="Production" connectionString="" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="RestServiceUrl" value="XXXXXXXXXXX" />
</appSettings>
<service.tasks>
<tasks>
<!-- App.config specified tasks are always recurring starting from whenever The Service first schedules it -->
<task name="ExpireRequirements" taskName="ExpireRequirements" recurrenceFactor="1" recurrenceType="Days" executeTime="01:00">
<parameters>
<param key="entityID">00000000-0000-0000-0000-000000000E01</param>
</parameters>
</task>
<task name="RequestExpiredRequirementsTask" taskName="RequestExpiredRequirementsTask" recurrenceFactor="1" recurrenceType="Days" executeTime="01:00">
<parameters>
<param key="entityID">00000000-0000-0000-0000-000000000E01</param>
<param key="CopyBatchSize">50</param>
</parameters>
</task>
<task name="UpdateRequirementChecksEffectiveDateTask" taskName="UpdateRequirementChecksEffectiveDateTask" recurrenceFactor="1" recurrenceType="Days" executeTime="01:00">
<parameters>
<param key="entityID">00000000-0000-0000-0000-000000000E01</param>
</parameters>
</task>
<task name="PeoplenetMatchAssignmentRefresh" taskName="PeoplenetMatchAssignmentRefresh">
<parameters>
<param key="checkInterval">300000</param>
<param key="batchCount">100</param>
</parameters>
</task>
</tasks>
</service.tasks>
<system.net>
<connectionManagement>
<add address="*" maxconnection="48" />
</connectionManagement>
</system.net>
<system.runtime.remoting>
<application name="server">
<channels>
<channel ref="tcp" port="8090">
<serverProviders>
<formatter ref="soap" typeFilterLevel="Full" />
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
How to change the values inside the service.tasks tag and system.runtime.remoting tags.

Refer to this code to update entityID value in ExpireRequirements task element (specify config file path in argument:-webCofig xxx):
param(
[string]$webConfig
)
$doc = (Get-Content $webConfig) -as [Xml]
$root=$doc.get_DocumentElement()
$ExpireRequirementsTask=$root."service.tasks"."tasks"."task" | where {$_.name -eq 'ExpireRequirements'}
Write-Output $ExpireRequirementsTask
$ExpireRequirementsTaskEntityID=$ExpireRequirementsTask."parameters"."param" | where {$_.key -eq 'entityID'}
Write-Output $ExpireRequirementsTaskEntityID
$ExpireRequirementsTaskEntityID.InnerText="11111111-0000-0000-0000-000000000E01"
$doc.Save($webConfig)

Related

BizTalk "Receive Location" status remains disabled despite "Enable" attribute equal true in binding file

I imported the sample binding file from "BizTalk Server Administration Console" -> "Import -> Bindings...".
It created receive location successfully but despite in the file <Enable>true</Enable>, it created locations with status as disabled.
Is it possible to make it enable with the binding file?
<?xml version="1.0" encoding="utf-8"?>
<BindingInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Assembly="Microsoft.BizTalk.Deployment, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Version="3.5.1.0" BindingStatus="PartiallyBound" BoundEndpoints="43" TotalEndpoints="47">
<Timestamp>2017-09-11T11:27:28.7543844+03:00</Timestamp>
<DistributionListCollection />
<ReceivePortCollection>
<ReceivePort Name="XXXXXXXXXXX" IsTwoWay="true" BindingOption="1">
<Description xsi:nil="true" />
<ReceiveLocations>
<ReceiveLocation Name="XXXXXXXXX_ReceiveLocation">
<Description xsi:nil="true" />
<Address>net.pipe://localhost/XXXXXXXXXX</Address>
<PublicAddress />
<Primary>false</Primary>
<ReceiveLocationServiceWindowEnabled>false</ReceiveLocationServiceWindowEnabled>
<ReceiveLocationFromTime>2000-01-01T21:00:00</ReceiveLocationFromTime>
<ReceiveLocationToTime>2000-01-01T20:59:59</ReceiveLocationToTime>
<ReceiveLocationStartDateEnabled>false</ReceiveLocationStartDateEnabled>
<ReceiveLocationStartDate>2009-05-05T00:00:00</ReceiveLocationStartDate>
<ReceiveLocationEndDateEnabled>false</ReceiveLocationEndDateEnabled>
<ReceiveLocationEndDate>2009-05-06T23:59:59</ReceiveLocationEndDate>
<ReceiveLocationTransportType Name="WCF-NetNamedPipe" Capabilities="907" ConfigurationClsid="148d2e28-d634-4127-aa9e-7d6298156bf1" />
<ReceiveLocationTransportTypeData><CustomProps><UseSSO vt="11">0</UseSSO><InboundBodyLocation vt="8">UseBodyPath</InboundBodyLocation><InboundBodyPathExpression vt="8">/*[local-name()='part']</InboundBodyPathExpression><SendTimeout vt="8">00:30:00</SendTimeout><OutboundXmlTemplate vt="8">&lt;bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="xml"/&gt;</OutboundXmlTemplate><OpenTimeout vt="8">00:30:00</OpenTimeout><SecurityMode vt="8">Transport</SecurityMode><TransactionProtocol vt="8">OleTransactions</TransactionProtocol><MaxReceivedMessageSize vt="3">2147483647</MaxReceivedMessageSize><TransportProtectionLevel vt="8">EncryptAndSign</TransportProtectionLevel><CloseTimeout vt="8">00:30:00</CloseTimeout><SuspendMessageOnFailure vt="11">-1</SuspendMessageOnFailure><EnableTransaction vt="11">0</EnableTransaction><InboundNodeEncoding vt="8">Base64</InboundNodeEncoding><IncludeExceptionDetailInFaults vt="11">-1</IncludeExceptionDetailInFaults><MaxConcurrentCalls vt="3">300</MaxConcurrentCalls><OutboundBodyLocation vt="8">UseBodyElement</OutboundBodyLocation></CustomProps></ReceiveLocationTransportTypeData>
<ReceivePipeline Name="Microsoft.BizTalk.DefaultPipelines.XMLReceive" FullyQualifiedName="Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="1" TrackingOption="ServiceStartEnd MessageSendReceive PipelineEvents" Description="" />
<ReceivePipelineData xsi:nil="true" />
<SendPipeline Name="Microsoft.BizTalk.DefaultPipelines.PassThruTransmit" FullyQualifiedName="Microsoft.BizTalk.DefaultPipelines.PassThruTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="2" TrackingOption="ServiceStartEnd MessageSendReceive PipelineEvents" Description="" />
<SendPipelineData xsi:nil="true" />
<Enable>true</Enable>
<ReceiveHandler Name="BizTalkServerApplication" HostTrusted="true">
<TransportType Name="WCF-NetNamedPipe" Capabilities="907" ConfigurationClsid="148d2e28-d634-4127-aa9e-7d6298156bf1" />
</ReceiveHandler>
</ReceiveLocation>
</ReceiveLocations>
<SendPipelineData xsi:nil="true" />
<Authentication>0</Authentication>
<Tracking>255</Tracking>
<OutboundTransforms />
<RouteFailedMessage>false</RouteFailedMessage>
<ApplicationName>XXXXXXXXXXX</ApplicationName>
</ReceivePort>
</ReceivePortCollection>
<PartyCollection />
</BindingInfo>
IMHO is not possible, you have to import the bindings and then enable the Receive Locations through the Admin Console or PowerShell or WMI, ...

CustomTraceListener class implementation for tracing HTTP requests

I have been trying to use CustomTraceListener class to have my own custom trace listener in place. The configuration is done as per MSDN but it fails with an error saying:
System.Configuration.ConfigurationErrorsException was unhandled by user code
HResult=-2146232062
Message=Could not create TraceLib.DebugTraceListener,TraceLib.
Source=mscorlib
BareMessage=Could not create TraceLib.DebugTraceListener,TraceLib.
Line=0
StackTrace:
Server stack trace:
at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData)
at System.Diagnostics.TypedElement.BaseGetRuntimeObject()
at System.Diagnostics.ListenerElement.GetRuntimeObject()
at System.Diagnostics.ListenerElement.GetRuntimeObject()
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
at System.Diagnostics.TraceSource.Initialize()
at System.Net.Logging.InitializeLogging()
at System.Net.Logging.get_On()
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
Config:
<system.diagnostics>
<sources>
<source name="System.Net" >
<listeners>
<add name="MyTrace"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="MyTrace" type="TraceLib.DebugTraceListener,TraceLib" initializeData="System.Net.trace.log"/>
</sharedListeners>
<switches>
<add name="System.Net" value="Information" />
</switches>
</system.diagnostics>
Any clue?
Fixed the config and it worked!
<system.diagnostics>
<sources>
<source name="System.Net" >
<listeners>
<add name="MyTrace"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="MyTrace" type="TraceLib.DebugTraceListener,TraceLib" />
</sharedListeners>
<switches>
<add name="System.Net" value="Information" />
</switches>
</system.diagnostics>
The "initializeData" attribute was not required.

Access Denied when deploying ASP.net 5

I'm trying to deploy an ASP.net 5 website to my local service fabric dev cluster but get an Access Denied exception on every deploy. I know that the problem is with the web service because when I remove it from the deployment my other service is deployed without any error
This exception looks like it is trying to delete a file, but which one and why wouldn't it have access?
6>. 'E:\Github\Flow.Server\Flow.Server.Fabric\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'E:\Github\Flow.Server\Flow.Server.Fabric\pkg\Debug' -PublishProfileFile 'E:\Github\Flow.Server\Flow.Server.Fabric\PublishProfiles\Local.xml' -DeployOnly:$true -UnregisterUnusedApplicationVersionsAfterUpgrade $false -OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -ErrorAction Stop
6>Message : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
6>Data : {}
6>InnerException :
6>TargetSite : Void RunInMTA(System.Action)
6>StackTrace : at System.Fabric.Interop.Utility.RunInMTA(Action action)
6> at System.Fabric.Common.FabricDirectory.Delete(String path, Boolean recursive, Boolean
6> deleteReadOnlyFiles)
6> at Microsoft.ServiceFabric.Powershell.ApplicationCmdletBase.TestApplicationPackage(String
6> applicationPackagePath, Hashtable applicationParameters, String imageStoreConnectionString)
6> at System.Management.Automation.CommandProcessor.ProcessRecord()
6>HelpLink :
6>Source : System.Fabric
6>HResult : -2147024891
Here is my ApplicationManifest
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="Flow.Server.FabricType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="Silo_InstanceCount" DefaultValue="-1" />
</Parameters>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Flow.Server.Fabric.WebApi" ServiceManifestVersion="1.0.0" />
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Flow.Server.Fabric.SiloPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
</ServiceManifestImport>
<DefaultServices>
<Service Name="Flow.Server.Fabric.WebApiService">
<StatelessService ServiceTypeName="Flow.Server.Fabric.WebApiType">
<SingletonPartition />
</StatelessService>
</Service>
<Service Name="Flow.Server.Fabric.Silo">
<StatelessService ServiceTypeName="Flow.Server.Fabric.SiloType" InstanceCount="[Silo_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
And here is the ServiceManifest
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="Flow.Server.Fabric.WebApi" Version="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="Flow.Server.Fabric.WebApiType">
<Extensions>
<Extension Name="__GeneratedServiceType__">
<GeneratedNames xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
<DefaultService Name="Flow.Server.Fabric.WebApiService" />
<ServiceEndpoint Name="Flow.Server.Fabric.WebApiTypeEndpoint" />
</GeneratedNames>
</Extension>
</Extensions>
</StatelessServiceType>
</ServiceTypes>
<CodePackage Name="C" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>approot\runtimes\dnx-clr-win-x64.1.0.0-rc1-update1\bin\dnx.exe</Program>
<Arguments>--appbase approot\src\Flow.Server.Fabric.WebApi Microsoft.Dnx.ApplicationHost Microsoft.ServiceFabric.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener</Arguments>
<WorkingFolder>CodePackage</WorkingFolder>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048" />
</ExeHost>
</EntryPoint>
</CodePackage>
<Resources>
<Endpoints>
<Endpoint Name="Flow.Server.Fabric.WebApiTypeEndpoint" Protocol="http" Type="Input" />
</Endpoints>
</Resources>
</ServiceManifest>

How to setup embedded master/master replication with OrientDB?

My goal is to have two nodes. Node A should write some vertices and node B should be able to read those vertices.
So far my hazelcast discovery works just fine. OrientDB will also hot deploy any found database from nodeA to nodeB. Unfortunately any write on Node A will not be replicated to nodeB.
My setup:
orientdb-server-config.xml:
Simplified version (copied from orientdb-community tar.gz)
%NODENAME% will be replaced with nodeA or nodeB.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orient-server>
<handlers>
<handler
class="com.orientechnologies.orient.graph.handler.OGraphServerHandler">
<parameters>
<parameter name="enabled" value="true" />
<parameter name="graph.pool.max" value="50" />
</parameters>
</handler>
<!-- CLUSTER PLUGIN, TO TURN ON SET THE 'ENABLED' PARAMETER TO 'true' -->
<handler
class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin">
<parameters>
<parameter name="nodeName" value="%NODENAME%" />
<parameter name="enabled" value="true" />
<parameter name="configuration.db.default"
value="config/default-distributed-db-config.json" />
<parameter name="configuration.hazelcast" value="config/hazelcast.xml" />
</parameters>
</handler>
</handlers>
<network>
<sockets>
<socket
implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory"
name="ssl">
<parameters>
<parameter value="false" name="network.ssl.clientAuth" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore" />
<parameter value="password" name="network.ssl.keyStorePassword" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore" />
<parameter value="password" name="network.ssl.trustStorePassword" />
</parameters>
</socket>
<socket
implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory"
name="https">
<parameters>
<parameter value="false" name="network.ssl.clientAuth" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore" />
<parameter value="password" name="network.ssl.keyStorePassword" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore" />
<parameter value="password" name="network.ssl.trustStorePassword" />
</parameters>
</socket>
</sockets>
<protocols>
<!-- Default registered protocol. It reads commands using the HTTP protocol
and write data locally -->
<protocol name="binary"
implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" />
<protocol name="http"
implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb" />
</protocols>
<listeners>
<listener protocol="binary" ip-address="0.0.0.0" port-range="2424-2430"
socket="default" />
<!-- <listener protocol="binary" ip-address="0.0.0.0" port-range="2434-2440"
socket="ssl"/> -->
<listener protocol="http" ip-address="0.0.0.0" port-range="2480-2490"
socket="default">
<parameters>
<!-- Connection's custom parameters. If not specified the global configuration
will be taken -->
<parameter name="network.http.charset" value="utf-8" />
<parameter value="true" name="network.http.jsonResponseError" />
<!-- Define additional HTTP headers to always send as response -->
<!-- Allow cross-site scripting -->
<!-- parameter name="network.http.additionalResponseHeaders" value="Access-Control-Allow-Origin:
*;Access-Control-Allow-Credentials: true" / -->
</parameters>
<commands>
<command
pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg GET|*.json GET|*.woff GET|*.woff2 GET|*.ttf GET|*.svgz"
implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent">
<parameters>
<!-- Don't cache html resources in development mode -->
<entry name="http.cache:*.htm *.html"
value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" />
<!-- Default caching -->
<entry name="http.cache:default" value="Cache-Control: max-age=120" />
</parameters>
</command>
<command pattern="GET|gephi/*"
implementation="com.orientechnologies.orient.graph.server.command.OServerCommandGetGephi" />
</commands>
</listener>
</listeners>
<cluster>
</cluster>
</network>
<!-- <storages> <storage name="db_%NODENAME%" path="%DB_PATH%" userName="admin"
userPassword="admin" loaded-at-startup="true" /> </storages> -->
<users>
<user name="root" password="finger" resources="*" />
<user name="admin" password="finger" resources="*" />
</users>
<properties>
<!-- DATABASE POOL: size min/max -->
<entry name="db.pool.min" value="1" />
<entry name="db.pool.max" value="50" />
<!-- PROFILER: configures the profiler as <seconds-for-snapshot>,<archive-snapshot-size>,<summary-size> -->
<entry name="profiler.enabled" value="true" />
<!-- <entry name="profiler.config" value="30,10,10" /> -->
<entry name="plugin.directory" value="%PLUGIN_DIRECTORY%" />
<!-- LOG: enable/Disable logging. Levels are: finer, fine, finest, info,
warning -->
<entry name="log.console.level" value="%CONSOLE_LOG_LEVEL%" />
<entry name="log.file.level" value="%FILE_LOG_LEVEL%" />
</properties>
</orient-server>
default-distributed-db-config.json:
{
"autoDeploy": true,
"hotAlignment": true,
"executionMode": "synchronous",
"readQuorum": 1,
"writeQuorum": 1,
"failureAvailableNodesLessQuorum": false,
"readYourWrites": true,
"servers": {
"*": "master"
},
"clusters": {
"internal": {
},
"index": {
},
"*": {
"servers": ["<NEW_NODE>"]
}
}
}
Start OServer:
OServer server = OServerMain.create();
server.startup(getOrientServerConfig());
server.activate();
Wait until both nodes have been started.
Each node connects to the graph database.
OrientGraphFactory factory = new OrientGraphFactory("plocal:" + new File("databases/db_testdb").getAbsolutePath());
NodeA will add new vertices using getNoTx.
NodeB will just read the graph and count the found vertices using getNoTx.
I created a very basic maven project which contains two tests that will start nodeA and nodeB.
It is mandatory to set the ORIENTDB_HOME property for each node. The property must be set that way so that the $ORIENTDB_HOME/databases folder can be located. I have updated the maven project.
Each node can set the property for example this way:
String orientdbHome = new File("").getAbsolutePath();
System.setProperty("ORIENTDB_HOME", orientdbHome);

Quartz.net clustered is throwing error

I am trying to run quartz.net in clustered environment (2 quartz services using single database as job datastore). I have set quartz.jobStore.clustered = true and other properties as below in quartz.exe.config
<quartz>
<add key="quartz.jobStore.tablePrefix" value="Qrtz_"/>
<add key="quartz.jobStore.misfireThreshold" value="60000"/>
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"/>
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz"/>
<add key="quartz.jobStore.dataSource" value="myDS"/>
<add key="quartz.dataSource.myDS.connectionString" value="Server=DEV1;user=dev2;password=P&ssW0rd;database=DATAU"/>
<add key="quartz.jobStore.useProperties" value="false"/>
<add key="quartz.dataSource.myDS.provider" value="SqlServer-20"/>
<add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter, Quartz"/>
<add key="quartz.scheduler.exporter.port" value="555"/>
<add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler"/>
<add key="quartz.scheduler.exporter.channelType" value="tcp"/>
<add key="quartz.scheduler.exporter.channelName" value="httpQuartz"/>
<add key="quartz.jobStore.clustered" value="true" />
</quartz>
However, I am getting following error
ERROR Quartz.Impl.AdoJobStore.JobStoreTX - ClusterManager: Error managing cluster: Failure obtaining db row lock: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
I am using SQL2012 (with latest Service Pack applied) as job store.
Further, I tried replace the lock query with following property as below
<add key="quartz.jobStore.selectWithLockSQL" value="SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = '?'" />
If I do that, I am getting following error
[QuartzScheduler_QuartzScheduler-NON_CLUSTERED_MisfireHandler] ERROR Quartz.Impl.AdoJobStore.JobStoreTX - MisfireHandler: Error handling misfires: Failure obtaining db row lock: Violation of PRIMARY KEY constraint 'PK_QRTZ_LOCKS'. Cannot insert duplicate key in object 'dbo.QRTZ_LOCKS'. The duplicate key value is (QuartzScheduler, TRIGGER_ACCESS).
As requested in the comment, here is my full working config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging"/>
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4net1211">
<arg key="configType" value="INLINE"/>
</factoryAdapter>
</logging>
</common>
<connectionStrings>
<add name="EARTHEntities" connectionString="metadata=res://*/DatabaseModel.EarthModel.csdl|res://*/DatabaseModel.DBhModel.ssdl|res://*/DatabaseModel.DBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=server;initial catalog=db;user=remoteuser;password=pwd;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient"/>
</connectionStrings>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-6level %logger - %message %exception%newline"/>
</layout>
</appender>
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-6level %logger - %message %exception%newline"/>
</layout>
</appender>
<appender name="GeneralLog" type="log4net.Appender.RollingFileAppender">
<file value="Quartz.log"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<datePattern value="yyyyMMdd"/>
<maxSizeRollBackups value="1"/>
<maximumFileSize value="5MB"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
</layout>
</appender>
<root>
<level value="INFO"/>
<appender-ref ref="GeneralLog"/>
<appender-ref ref="EventLogAppender"/>
<appender-ref ref="ConsoleAppender"/>
</root>
</log4net>
<!--
We use quartz.config for this server, you can always use configuration section if you want to.
Configuration section has precedence here.
-->
<quartz>
<add key="quartz.jobStore.tablePrefix" value="Qrtz_"/>
<add key="quartz.jobStore.misfireThreshold" value="60000"/>
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"/>
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz"/>
<add key="quartz.jobStore.dataSource" value="myDS"/>
<add key="quartz.dataSource.myDS.connectionString" value="Server=server;user=remoteuser;password=pwd;database=db"/>
<add key="quartz.jobStore.useProperties" value="false"/>
<add key="quartz.dataSource.myDS.provider" value="SqlServer-20"/>
<add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter, Quartz"/>
<add key="quartz.scheduler.exporter.port" value="555"/>
<add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler"/>
<add key="quartz.scheduler.exporter.channelType" value="tcp"/>
<add key="quartz.scheduler.exporter.channelName" value="httpQuartz"/>
<add key="quartz.jobStore.clustered" value="true" />
<add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz"/>
<add key="quartz.scheduler.instanceId" value="AUTO" />
</quartz>
Try playing with this config setting:
properties["quartz.jobStore.driverDelegateType"] = "Quartz.Impl.AdoJobStore.MSSQLDelegate, Quartz";
Wait, that one may be old....
Maybe this one:
<add key="quartz.jobStore.lockHandler.type"
value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz"/>
Found from this example:
https://groups.google.com/forum/#!topic/quartznet/Csw2un9KUy0
I'm going from memory....I don't have the working example I once had.....
Here is some code to help figure this one out:
So maybe using "Quartz.Impl.AdoJobStore.SqlServerDelegate" instead of "Quartz.Impl.AdoJobStore.StdAdoDelegate" is an option.
namespace Quartz.Impl.AdoJobStore
{
/// <summary>
/// A SQL Server specific driver delegate.
/// </summary>
/// <author>Marko Lahma</author>
public class SqlServerDelegate : StdAdoDelegate
{
namespace Quartz.Impl.AdoJobStore
{
/// <summary>
/// Provide thread/resource locking in order to protect
/// resources from being altered by multiple threads at the same time using
/// a db row update.
/// </summary>
/// <remarks>
/// <para>
/// <b>Note:</b> This Semaphore implementation is useful for databases that do
/// not support row locking via "SELECT FOR UPDATE" or SQL Server's type syntax.
/// </para>
/// <para>
/// As of Quartz.NET 2.0 version there is no need to use this implementation for
/// SQL Server databases.
/// </para>
/// </remarks>
/// <author>Marko Lahma (.NET)</author>
public class UpdateLockRowSemaphore : DBSemaphore
{