Tuesday, January 17, 2017

Users cannot view ACS reports.

For the ACS reports the permissions have to be configured in SCOM.

Click Administration--User Roles

If you do not have a role created. Create a new role called "ACS report viewers"

In the tab that opens add the groups in your AD or users in your AD that you would like to have permissions to view reports.

Tuesday, December 20, 2016

Scom Maintenance mode scheduler

#SCOM Maintenance mode scheduler. The assemblies can be found in this folder on your management servers  C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Server\SDK Binaries

$scriptdir = Get-location
$ScriptDir = split-path -parent $MyInvocation.MyCommand.Path
$void = [System.Reflection.Assembly]::LoadFile("$scriptdir\Microsoft.EnterpriseManagement.OperationsManager.dll")
$void3 = [System.Reflection.Assembly]::LoadFile("$scriptdir\Microsoft.EnterpriseManagement.Runtime.dll")
$void1 = [System.Reflection.Assembly]::LoadFile("$scriptdir\Microsoft.EnterpriseManagement.Core.dll")

$server = "testsql"

$RootMS = "testdc01"
$Minutes =  60
$Comment = "Scheduled Maintenance Request"
$MGConnSetting = New-Object Microsoft.EnterpriseManagement.ManagementGroupConnectionSettings($RootMS)
$MG = New-Object Microsoft.EnterpriseManagement.ManagementGroup($MGConnSetting)
$Admin = $MG.GetAdministration()
$Agents = $admin.GetAllAgentManagedComputers()
$agent = $Agents | ?{$_.Computername -match $server}
$monitoring =$MG.Monitoring
$AllClasses = $MG.GetMonitoringClasses()
$MyClass = $AllClasses | ?{$_.name -eq "Microsoft.Windows.Computer"}
$Objects = $Mg.GetMonitoringObjects($Myclass)
$Object = $Objects | ?{$_.name -match $server}
$Object.schedulemaintenancemode
$startTime = [Datetime]'12/21/2016 04:26:00'
$StartTimeUTC = $startTime.ToUniversalTime()
$EndTime = $startTimeUTC.AddMinutes('10')
$Object.ScheduleMaintenanceMode($startTimeUTC,$EndTime,"PlannedOther",$Comment)