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
$Instance = "" | |
Set-DbaDatabaseOwner -SqlServer $Instance | |
Remove-SqlOrphanUser -SqlServer $Instance | |
Set-DbaQueryStoreConfig -SqlServer $Instance ` | |
-State ReadWrite ` | |
-FlushInterval 600 ` | |
-CollectionInterval 10 ` | |
-MaxSize 100 ` | |
-CaptureMode All ` | |
-CleanupMode Auto ` |
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
$server = "" | |
$app = Get-WmiObject -Class Win32_Product -computer $server | Where-Object {$_.Name -match "Microsoft Monitoring Agent"} | |
$app.Uninstall() |
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
kill <SPID> | |
USE [master] | |
ALTER DATABASE <DBName> | |
SET MULTI_USER | |
GO |
NewerOlder