🕵️♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param | |
( | |
[string] $PrimaryNinja = "Jane Doe", | |
[string] $SecondaryNinja = "John Smith" | |
) | |
$global:zendesk_user_name = "myaccount@mydomain.com/token" # The /token part is obligatory when using Zendesk's API | |
$global:zendesk_password = "put_your_zendesk_API_token_here" | |
$global:zendesk_address = "https://your_zendesk_subdomain_here.zendesk.com" | |
$global:primarySLAgroupname = "SLA Primary" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE master | |
GO | |
-- Using SQL Error Logs: | |
xp_readerrorlog 0, 1, N'Server is listening on', N'any', NULL, NULL, N'asc' | |
-- will also return records for DB Mirroring endpoints | |
-- also, this won't work if error log was cycled | |
GO | |
-- Using currently connected connections: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[version] $BuildNumber = "9.00.5324" | |
) | |
#Run this script with -ExecutionPolicy Bypass | |
Install-Module -Name SQLServerUpdatesModule | |
Import-Module SQLServerUpdatesModule | |
$ErrorActionPreference = "SilentlyContinue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param | |
( | |
[int] $ticketid, | |
[validateset ("new","open","pending","solved","closed","delete","same")] [string] $newstatus, | |
[string] $admincomment = "" | |
) | |
# Global Zendesk Settings: | |
$global:zendesk_address = "https://yourcompany.zendesk.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Fully Parameterized Search Query | |
-------------------------------- | |
Copyright Eitan Blumin (c) 2014; email: eitan@madeiradata.com | |
You may use the contents of this SQL script or parts of it, modified or otherwise | |
for any purpose that you wish (including commercial). | |
Under the single condition that you include in the script | |
this comment block unchanged, and the URL to the original source, which is: | |
http://www.madeiradata.com/author/eitan/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('tempdb..#tmp') IS NOT NULL DROP TABLE #tmp; | |
CREATE TABLE #tmp (DBName SYSNAME, SchemaName SYSNAME, TableName SYSNAME, FullTableName AS QUOTENAME(SchemaName) + N'.' + QUOTENAME(TableName), UntrustedObject SYSNAME); | |
INSERT INTO #tmp(DBName, SchemaName, TableName, UntrustedObject) | |
EXEC sp_MSforeachdb 'IF EXISTS (SELECT * FROM sys.databases WHERE state_desc = ''ONLINE'' AND name = ''?'' AND DATABASEPROPERTYEX(''?'', ''Updateability'') = ''READ_WRITE'') | |
BEGIN | |
USE [?]; | |
SELECT ''?'', OBJECT_SCHEMA_NAME(parent_object_id), OBJECT_NAME(parent_object_id), [name] | |
FROM [?].sys.foreign_keys | |
WHERE is_not_trusted = 1 AND is_not_for_replication = 0 AND is_disabled = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT SiteName, ReplicaName | |
, NumberOfAvailabilityGroups = COUNT(DISTINCT AGName) | |
, NumberOfPrimaries = COUNT(DISTINCT PrimaryReplica) | |
FROM | |
( | |
SELECT DISTINCT | |
ES.ObjectName AS ReplicaName, S.Name AS SiteName | |
, AG.Name AS AGName | |
, AG.PrimaryReplica | |
FROM [SentryOne].[AlwaysOn].[AvailabilityGroup] AS AG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('tempdb..#PrintMax') IS NOT NULL DROP PROC #PrintMax; | |
GO | |
/* | |
Author: Eitan Blumin (t: @EitanBlumin | b: eitanblumin.com) | |
Description: | |
This is a minified version of the PrintMax procedure (originally written by Ben Dill). | |
It's created as a temporary procedure. | |
*/ | |
CREATE PROCEDURE #PrintMax @str NVARCHAR(MAX) | |
AS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pre-Deployment Script Template for Importing a Signed CLR Assembly (SSDT Project) | |
-------------------------------------------------------------------------------------- | |
In order to use this script, you must configure the following SQLCMD Variables in your project: | |
$(PathToSignedDLL) | |
$(CLRKeyName) | |
$(CLRLoginName) | |
To configure your SQLCMD Variables: Right-click on your DB project, select "Properties", and go to "SQLCMD Variables". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2020 Eitan Blumin <@EitanBlumin, https://www.eitanblumin.com> | |
# while at Madeira Data Solutions <https://www.madeiradata.com> | |
# | |
# Licensed under the MIT License (the "License"); | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR CO |
OlderNewer