Post Installation ## This is a PS script to Perform the Post-Installation steps on 2012\14 ## Developer ## ## $ErrorActionPreference = "SilentlyContinue" #$M = read-host -prompt "Please enter the machine name: " $I = read-host -prompt "Please enter the full instance name eg., clwtd4000\SQL2008INS3: " $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&yes","" $no = New-Object System.Management.Automation.Host.ChoiceDescription "&no","" $choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes,$no) $caption = "Scom install" $message = "is this server prod?" $result = $Host.UI.PromptForChoice($caption,$message,$choices,0) [System.Reflection.Assembly]::LoadWithPartialName(‘Microsoft.SqlServer.SMO’) | out-null $login = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Login -ArgumentList $I, 'ad-ent\prv_edm_fa_srv_sqlservic...
Posts
Showing posts from August, 2016
- Get link
- X
- Other Apps
Powershell - M plan Add-Type -AssemblyName System.Windows.Forms $form = New-Object Windows.Forms.Form $form.Size = New-Object Drawing.Size @(700,500) $form.StartPosition = "CenterScreen" $objLabel = New-Object System.Windows.Forms.Label $objLabel.Location = New-Object System.Drawing.Size(10,20) $objLabel.Size = New-Object System.Drawing.Size(300,30) $objLabel.Text = "Enter Full Instance Name(CLWTD4000\Instance01)" $form.controls.Add($objLabel) $objInsBox = New-Object System.Windows.Forms.TextBox $objInsBox.Multiline = $true $objInsBox.Location = New-Object System.Drawing.Size(305,20) $objInsBox.Size = New-Object System.Drawing.Size(330,20) $form.controls.Add($objInsBox) $drives = Get-WmiObject -Class Win32_Volume | Where-Object {$_.FreeSpace -gt 1073741824} #Get Drive Information Foreach ($drive in $drives) { $rootdrive = ($drive.Caption).TrimEnd("\") If ($rootdrive -ne "C:" -and $AvailDrives -...
- Get link
- X
- Other Apps
Maintenacne Plan creation USE [msdb] GO DECLARE @sqlInstance varchar(20) SET @sqlInstance = '$(instanceName)' DECLARE @BackUpSubPlan sysname SET @BackUpSubPlan = 'Back Up Database Task' DECLARE @BackUpJobName sysname SET @BackUpJobName = 'System databases.' + @BackUpSubPlan DECLARE @ChkDbSubPlan sysname SET @ChkDbSubPlan = 'Check Database Integrity Task' DECLARE @ChkDbJobName sysname SET @ChkDbJobName = 'System databases.' + @ChkDbSubPlan DECLARE @RebuildIndexSubPlan sysname SET @RebuildIndexSubPlan = 'Rebuild Index Task' DECLARE @RebuildIndexJobName sysname SET @RebuildIndexJobName = 'System databases.' + @RebuildIndexSubPlan DECLARE @UpdStatsSubPlan sysname SET @UpdStatsSubPlan = 'Update Statistics Task' DECLARE @UpdStatsJobName sysname SET @UpdStatsJobName = 'System databases.' + @UpdStatsSubPlan DECLARE @HistClnSubPlan sysname SET @HistClnSubPlan = 'History Cleanup Task' ...