Skip to content

Instantly share code, notes, and snippets.

@desek
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desek/3fe28f9a8996f522be81 to your computer and use it in GitHub Desktop.
Save desek/3fe28f9a8996f522be81 to your computer and use it in GitHub Desktop.
Disable SCSM Cube processing and disable SSAS
# 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