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 DB_NAME(mf.database_id) database_name, | |
mf.name logical_name, | |
mf.file_id, | |
CONVERT (DECIMAL (20,2), | |
(CONVERT(DECIMAL, size)/128)) as [file_size_MB], | |
CASE mf.is_percent_growth | |
WHEN 1 | |
THEN 'Yes' | |
ELSE 'No' |
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
$Servers = '' | |
Invoke-Command -ComputerName $Servers { | |
Import-Module -Name WebAdministration | |
$Websites = Get-Website | |
foreach ($Website in $Websites) | |
{ | |
$AppPool = $Website.applicationPool | |
If ((Get-WebAppPoolState -Name $AppPool).Value -eq 'Stopped') {Start-WebAppPool -Name $AppPool} | |
$SiteState = $Website.State |
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
Write-Output "Loaded Add-SQLDBUserToRole function" | |
Function Add-SQLDBUserToRole { | |
Param ( | |
[string] $server, | |
[String] $Database , | |
[string]$User, | |
[string]$Role | |
) | |
$Svr = New-Object ('Microsoft.SqlServer.Management.Smo.Server') $server | |
$db = $svr.Databases[$Database] |
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 [DatabaseLogins] | |
CREATE TABLE [dbo].[DbaTools-WatchDbLogins]( | |
[ComputerName] [nvarchar](max) NULL, | |
[InstanceName] [nvarchar](max) NULL, | |
[SqlInstance] [nvarchar](max) NULL, | |
[LoginTime] [datetime2](7) NULL, | |
[Login] [nvarchar](max) NULL, | |
[Host] [nvarchar](max) NULL, | |
[Program] [nvarchar](max) NULL, |
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
function Install-dbatools { | |
Import-Module dbatools -ErrorAction SilentlyContinue | |
if((Get-Module | Where-Object {$_.Name -eq "dbatools"}) -eq $null) { | |
Write-Output "dbatools module installing" | |
Install-Module dbatools -force | |
} | |
else { | |
Write-Output "dbatools module already installed" | |
} | |
} |
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
Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d | |
Get-WUInstall –MicrosoftUpdate –AcceptAll –AutoReboot |
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
Function Set-SQLMSXEncryptionChannelOff | |
{ | |
$Path = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.SE\SQLServerAgent" | |
$Name = "MsxEncryptChannelOptions" | |
$DefaultValue = "2" | |
$NewValue = "0" | |
$ComputerName = $Env:COMPUTERNAME | |
$Item = (Get-ItemProperty $Path -Name $Name).$Name | |
if($Item -eq $DefaultValue) | |
{ |
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
Function Get-FolderSize { | |
[cmdletbinding()] | |
param | |
( | |
[Parameter(Mandatory = $false)] | |
[Alias('Path')] | |
[String[]] | |
$BasePath = 'C:\', | |
[Parameter(Mandatory = $false)] | |
[Alias('User')] |
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
# set strong cryptography on 64 bit .Net Framework (version 4 and above) | |
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord | |
# set strong cryptography on 32 bit .Net Framework (version 4 and above) | |
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord |
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
@font-face { | |
font-family: KaTeX_AMS; | |
src: url(/static/fonts/KaTeX_AMS-Regular.38a68f7.woff2) format("woff2"), url(/static/fonts/KaTeX_AMS-Regular.7d307e8.woff) format("woff"), url(/static/fonts/KaTeX_AMS-Regular.2dbe16b.ttf) format("truetype"); | |
font-weight: 400; | |
font-style: normal | |
} | |
@font-face { | |
font-family: KaTeX_Caligraphic; | |
src: url(/static/fonts/KaTeX_Caligraphic-Bold.342b296.woff2) format("woff2"), url(/static/fonts/KaTeX_Caligraphic-Bold.9634168.woff) format("woff"), url(/static/fonts/KaTeX_Caligraphic-Bold.33d2688.ttf) format("truetype"); |