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
#Note - will want to install "Chocolatey" first in order to use this file to install software. | |
# https://chocolatey.org/docs/installation | |
# Open a command prompt (cmd) and run the following: | |
# @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
# .. | |
# or open a PowerShell Admin prompt and run: | |
# Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
# After Chocolatey is installed, open a PS prompt in Administrator mode, |
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
--Adapted from http://www.chilledsql.com/welcome/tip_category_dateandtime/tip_detail_dateandtime_createmastercalendartable | |
--If this is an existing table, do not drop/recreate the table, just adjust dates and run the appropriate population script | |
--Adjust code to ignore dates already in the calendar table. | |
SET NOCOUNT ON | |
SET ANSI_WARNINGS ON | |
SET ARITHABORT ON | |
SET ARITHIGNORE ON |
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
/* Adapted from ChilledSql.com */ | |
/* https://www.chilledsql.com/welcome/tip_category_dateandtime/tip_detail_dateandtime_createmastercalendartable */ | |
/* Update the Start/End dates as appropriate for your needs */ | |
/* This is done after all creates */ | |
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED | |
SET NOCOUNT ON | |
SET ANSI_WARNINGS OFF | |
SET ARITHABORT OFF |
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
#requires dbatools | |
$server = "servername" | |
$localCertPath = "C:\CertificateRequests" | |
$remoteCertPath = "C:\CertificateRequest\" | |
$adminuser = Import-Clixml C:\user.cred #stored credentials to access remote server | |
# Generate the CSR and download locally | |
$session = New-PSSession $server -Credential $adminuser |
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
#Create new Certificate Request for SQL Server security | |
# Should be made into a function at some point | |
# Needs to be able to handle Cluster names/IP addresses | |
#Set location of the server | |
$Location = "City" | |
$State = "State" | |
$OU = "OU" | |
$Company = "Organization" |
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
# requires gtts | |
# requires pydub | |
# requires ffmpeg to be installed on the system | |
from gtts import gTTS | |
from pydub import AudioSegment | |
import os | |
def generate_word_audio(word, output_folder='audio'): | |
if not os.path.exists(output_folder): |
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
/* Get all db principals and their roles for Azure SQL */ | |
SELECT | |
@@ServerName as ServerName, | |
DB_NAME() as DatabaseName, | |
pr.name AS PrincipalName, | |
pr.type_desc AS PrincipalType, | |
r.name AS RoleName, | |
dp.state_desc AS RoleState, | |
NULL as PermissionName, | |
NULL as PermissionState, |
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
<# | |
Code Type: Function | |
Description: Restore the missing Package(*.msi)/Patches(*.msp) files from another remote source (machine or folder). | |
Author: Ahmad Gad | |
Contact Email: ahmad.gad@jemmpress.com, ahmad.adel@jemmail.com | |
WebSite: http://ahmad.jempress.com | |
Created On: 21/09/2016 | |
Updated On: 11/03/2017 | |
Title: Restore-InstallerFiles | |
Minimum PowerShell Version: 2.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
CREATE TABLE TriggerStatus ( | |
TriggerStatusID INT IDENTITY(1,1) NOT NULL, | |
TriggerName varchar(100) NOT NULL, | |
IsEnabled BIT NOT NULL CONSTRAINT DF_TriggerStatus_IsEnabled DEFAULT 1, | |
CONSTRAINT PK_TriggerStatus PRIMARY KEY CLUSTERED (TriggerStatusID) | |
) | |
GO | |
CREATE TABLE MyAuditTable ( | |
MyAuditTableID INT NOT NULL IDENTITY(1,1), |
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 SSISDB | |
GO | |
CREATE PROC dbo.usp_PurgeSSISCatalogLogs | |
@RowsToDelete int = 5000 | |
AS | |
BEGIN --Proc | |
/* | |
Script name: Purge SSIS Catalog log tables | |
Author: Tim Mitchell (www.TimMitchell.net) |
NewerOlder