Last active
August 29, 2015 14:06
-
-
Save desek/3fe28f9a8996f522be81 to your computer and use it in GitHub Desktop.
Disable SCSM Cube processing and disable SSAS
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
# Script to remotely stoping and disabling all SCSM Cube Procesing jobs and SSAS instance | |
$SMDWServer = "" | |
$SSASServer = "" | |
$SSASInstanceName = "MSSQLSERVER" | |
Invoke-Command -ScriptBlock { | |
$smdir = (Get-ItemProperty "HKLM:\Software\Microsoft\System Center\2010\Service Manager\Setup").InstallDirectory | |
Import-Module "$smdir\Microsoft.EnterpriseManagement.Warehouse.Cmdlets.psd1" | |
$DWJobs = Get-SCDWJob | Where-Object {$_.Name -like "Process.*"} | |
Foreach ($DWJob in $SCDWJobs) | |
{ | |
Disable-SCDWJobSchedule -JobName $Job.Name -Verbose | |
Disable-SCDWJob -JobName $Job.Name -Verbose | |
Stop-SCDWJob -JobName $Job.Name -Verbose | |
} | |
} -ComputerName $SMDWServer | |
Invoke-Command -ScriptBlock { | |
$ServiceName = "SQL Server Analysis Services ($($args[0]))" | |
$Service = Get-Service -DisplayName $ServiceName | |
Set-Service -InputObject $Service -StartupType Manual -Verbose | |
Stop-Service -InputObject $Service -Verbose | |
} -ComputerName $SSASServer -ArgumentList $SSASInstanceName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment