This file contains hidden or 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 EVENT SESSION [MonitorWindowsLogins] ON SERVER | |
| ADD EVENT sqlserver.login( | |
| ACTION(sqlserver.client_hostname,sqlserver.database_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name) | |
| WHERE ([sqlserver].[not_equal_i_sql_unicode_string]([sqlserver].[session_nt_user],N'') | |
| AND [sqlserver].[not_equal_i_sql_unicode_string]([sqlserver].[session_server_principal_name],N'THEBEARD\gsartori') | |
| AND [sqlserver].[not_equal_i_sql_unicode_string]([sqlserver].[session_server_principal_name],N'THEBEARD\wdurkin') | |
| AND [sqlserver].[not_equal_i_sql_unicode_string]([sqlserver].[session_server_principal_name],N'THEBEARD\Rob') | |
| AND [sqlserver].[session_nt_user]<>N'THEBEARD\gfritchey' | |
| AND [sqlserver].[session_server_principal_name]<>N'THEBEARD\SQL_SVC' | |
| AND [sqlserver].[session_server_principal_name]<>N'THEBEARD\SQL2014SER12R2$')) |
This file contains hidden or 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 Calm { | |
| for ($i = 0; $i -le 4; $i++) { | |
| $x = 1 | |
| while ($x -le 4) { | |
| "In through the nose - $x" | |
| Start-Sleep -Seconds 1 | |
| $x ++ | |
| } | |
| $x = 1 | |
| while ($x -le 7) { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| $ErrorActionPreference = 'Stop' | |
| # read in the certificate from a pre-existing PFX file | |
| # I have checked this with IISResetMe and this does not go in the store only memory | |
| $cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new("$(Agent.WorkFolder)\_temp\dbatools-code-signing-cert.pfx","$(CertPassword)") | |
| try { | |
| Write-Output "Signing Files" | |
| # find all scripts in your module... | |
| Get-ChildItem -Filter *.ps1 -Include *.ps1 -Recurse -ErrorAction SilentlyContinue | | |
| # ...that do not have a signature yet... |
This file contains hidden or 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
| $Pattern = 'SPN' | |
| $script:localapp = Get-DbcConfigValue -Name app.localapp | |
| if ($Pattern) { | |
| if ($Pattern -notmatch '\*') { | |
| @(Get-Content "$script:localapp\checks.json" | Out-String | ConvertFrom-Json).ForEach{ | |
| $output = $psitem | Where-Object { | |
| $_.Group -match $Pattern -or $_.Description -match $Pattern -or | |
| $_.UniqueTag -match $Pattern -or $_.AllTags -match $Pattern -or $_.Type -match $Pattern | |
| } | |
| } |