跳到主要內容

Microsoft System Powershell

$compObject = get-wmiobject -query "select * from SMS_R_SYSTEM WHERE Name='[computername]'" -computername [sccm-server] -namespace "ROOT\SMS\site_[yoursite]"
$compObject.psbase.delete()


Remove-DisabledMonitoringObject
Remove-SCOMDisabledClassInstance

# To find out what options are available to your output of the list of objects in the group use Get-Member (GM) cmdlet
Get-SCOMGroup -DisplayName "UR Computer Group" | Get-SCOMClassInstance | GM

# after looking at the GM output we decide that DisplayName will work best
Get-SCOMGroup -DisplayName "UR Computer Group" | Get-SCOMClassInstance | sort DisplayName |FT DisplayName


For UIGeneratedMonitor:
Get-SCOMMonitor | where {$_.name -eq "UIGeneratedMonitorGUID#"} | select DisplayName

For UIGeneratedRule:
Get-SCOMRule | where {$_.name -eq "MomUIGeneratedRuleGUID#"} | select DisplayName

Create SCOM 2012 Subscribers using PowerShell
Add-SCOMNotificationSubscriber -Name ‘James Moss’ -DeviceList ‘james@contoso.com‘,’sms:4048675309′,’sip:JIMMYjames’

Deploying agents with Powershell
PS C:\> $PrimaryMgmtServer = Get-SCOMManagementServer -Name "omvnextqa03.qa.net"
PS C:\> Install-SCOMAgent -Name "Mdbqa01.qa.net" -PrimaryManagementServer $PrimaryMgmtServer

How To backup all SCOM MPs
Get-SCManagementPack | Export-SCManagementPack -path C:\MPDUMP

GET-SCOMAGENT
Disable-SCOMMonitor
Get-SCOMPendingManagement | where {$_.AgentPendingActionType -eq "ManualApproval"} | Approve-SCOMPendingManagement -WhatIf

###
[Reflection.Assembly]::Load(“Microsoft.EnterpriseManagement.Core, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″)
[Reflection.Assembly]::Load(“Microsoft.EnterpriseManagement.OperationsManager, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″)

    $mg = [Microsoft.EnterpriseManagement.ManagementGroup]::Connect(“localhost”)
    $mg.EntityObjects.DeleteDisabledObjects()

###

Deleting Agents



To determine what discoveries are still associated with a computer – helpful in finding old stale computer objects in the console that are no longer agent managed, or desired.
select BME.FullName, DS.DiscoveryRuleID, D.DiscoveryName from typedmanagedentity TME
Join BaseManagedEntity BME ON TME.BaseManagedEntityId = BME.BaseManagedEntityId
JOIN DiscoverySourceToTypedManagedEntity DSTME ON TME.TypedManagedEntityID = DSTME.TypedManagedEntityID
JOIN DiscoverySource DS ON DS.DiscoverySourceID = DSTME.DiscoverySourceID
JOIN Discovery D ON DS.DiscoveryRuleID=D.DiscoveryID
Where BME.Fullname like '%ComputerName%'


Disable-SCOMMonitor
Enable-SCOMMonitor

留言

這個網誌中的熱門文章

[經驗分享]開源IT資產管理系統 - Open-AudIT

企業營運必定與電腦系統脫離不了關係,每一部電腦散落在各部門、各辦公室,若是較具規模的公司,甚至會有跨好幾個地區的辦公室存在。 from Pocket http://ift.tt/2sI5nuB via IFTTT

记录一次HomeKit智能家居实践

前言 想象一下,吃过晚饭,坐在沙发上,“嘿Siri,电视时间”,客厅灯关了,电视和电视盒子开了。过了很久,你困了,起身,“嘿Siri,准备睡觉”,卧室床头灯开了,电视和电视盒子关了,最后,你躺在床上,“嘿Siri, from Pocket https://ift.tt/2yAhmuK via IFTTT

Jitsi Meet 視訊會議教學:免費無限人數時間、共享桌面、錄影

想要試試看「 Jitsi Meet 」,在電腦上,直接打開「 」即可。不需註冊帳號,也不需安裝軟體。 「 Jitsi Meet 」的 App 端也不需要註冊帳號,可以直接開啟或加入視訊會議。 那麼如何在「 Jitsi Meet 」上開起一個視訊會議呢? 在視訊 from Pocket https://ift.tt/2wdd3Z1 via IFTTT