Skip to content

Instantly share code, notes, and snippets.

@jeroenmaes
jeroenmaes / CreateAccountsAndGroups.ps1
Created October 24, 2014 07:23
Create BizTalk Groups and Service Accounts with PowerShell
# Path where to create the biztalk groups and service accounts
$BtsOuPath = "OU=BizTalk,OU=Service Accounts,DC=LABO,DC=local"
# Path where to create the biztalk admin user
$AdminOuPath = "CN=Users,DC=LABO,DC=local"
$DomainAdmin = "JMADMIN"
$BtsAdmin = "BTSADMIN"
# Convert the plain text passwords
$BtsAdminPassword = ConvertTo-SecureString "P@$$w0rd0" -AsPlainText -Force
@jeroenmaes
jeroenmaes / CreateHostsAndHostInstances.ps1
Created October 24, 2014 07:28
Creating BizTalk Hosts and Host Instances
Function CreateHost($strHostName, $boolIsTrackingHost)
{
Set-Location 'BizTalk:\Platform Settings\Hosts'
New-Item -Path:$strHostName -HostType:'InProcess' -NtGroupName: $DomainName'\BizTalk Application Users' -AuthTrusted:$false
Set-ItemProperty -Path:$strHostName -Name:HostTracking -Value:$boolIsTrackingHost
Set-ItemProperty -Path:$strHostName -Name:Is32BitOnly -Value:$false
Cd \
}
@jeroenmaes
jeroenmaes / usp_delete_Faults.sql
Created October 28, 2014 09:09
ESB Toolkit: Cleaning ESBExceptionDb
USE [EsbExceptionDb]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[usp_delete_Faults]
@jeroenmaes
jeroenmaes / grant_esb_portal_rights.sql
Last active August 29, 2015 14:08
Fix ESB Portal Rights
USE EsbExceptionDb
GO
GRANT SELECT ON [dbo].[Alert] TO [ESBPortal]
GO
GRANT SELECT ON [dbo].[Alert] TO [ESBPortalAdmin]
GO
GRANT SELECT,INSERT,UPDATE,DELETE ON [dbo].[AlertCondition] TO [ESBPortal]
GO
GRANT SELECT,INSERT,UPDATE,DELETE ON [dbo].[AlertCondition] TO [ESBPortalAdmin]
GO
@jeroenmaes
jeroenmaes / GetBTSMapByInOutMessageType.sql
Last active December 5, 2015 10:54
Find the BizTalk map (mapname and assemblyname) in the BizTalkMgmtDb given the source and destination MessageType
DECLARE @msgtype_in varchar(255);
DECLARE @msgtype_out varchar(255);
set @msgtype_in = 'http://schemas.adventureworks.com/AX/AXPurchaseOrder#AXPurchaseOrder'
set @msgtype_out = 'http://schemas.adventureworks.com/XMLGate/OrderRequest#XMLGateOrderRequest'
USE BizTalkMgmtDb
SELECT top(1)
i.Name as MapName
@jeroenmaes
jeroenmaes / SlackClient.cs
Created March 8, 2016 09:34 — forked from jogleasonjr/SlackClient.cs
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
#r "Microsoft.ServiceBus"
using Microsoft.ServiceBus.Messaging;
using Microsoft.ServiceBus;
using System;
using System.Threading.Tasks;
public static void Run(BrokeredMessage myQueueItem, TraceWriter log, out BrokeredMessage outputSbMsg)
{
#https://www.saotn.org/iis-application-pool-recycle-on-specific-times-not-regular-time-interval/
Import-Module WebAdministration
$appPools = Get-ChildItem IIS:\apppools | where {$_.Name -match "APP1|APP2"}
$timeDiff = 0
$appPools | ForEach-Object {
$pool = $("IIS:\AppPools\") + ($_.Name)