跳到主要內容

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

留言

這個網誌中的熱門文章

How do I compile ffmpeg on a QNAP NAS

Tested on QNAP TS-419p+ with ARM CPU, but should work the same way for others. Install “Optware (IPKG)” qpkg from  http://www.qnap.com/qpkg.asp In case the “ipkg update” fails, try to adjust the following two config files: [/opt/etc/ipkg] # more tsx19-kmod.conf src/gz cs08q1armel http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable [/opt/etc/ipkg] # more tsx19.conf src/gz cs08q1armel http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable ipkg update ipkg install optware-devel ipkg install git ipkg install yasm ipkg install lame mkdir /opt/compile cd /opt/compile git clone git://git.videolan.org/ffmpeg.git cd ffmpeg ./configure --enable-ssse3 --prefix=/opt --extra-cflags='-I/opt/include' --extra-ldflags='-L/opt/lib' --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame make make install replace built-in ffmpeg with link to new version rm /usr/bin/ffmpeg ln -s /opt/bin/ffmpeg /usr/bin http://bubbl

Setting up a CUPS server with Docker on a Synology NAS for my Brother printer

I made the unfortunate mistake of purchasing a cheap brother printer, the Brother HL-L2300D, which is USB only. And not only is it a USB printer, it is a Winprinter which makes it very limited in anything other than Windows. from Pocket http://ift.tt/2gbYuYH via IFTTT

台灣第一家「真.無人商店」登場,711 推出台灣第一家臉部辨識無人超商!

【我們為什麼挑選這篇文章】上週我們才看了亞馬遜盛大開幕,這週 711 就公布了無人商店實驗店,在這如雨後春筍般的無人商店潮中,我們的生活正在疾速變動。但我覺得全家的概念也蠻有意思的:「與其推出一間跨時代概 from Pocket http://ift.tt/2BCDxQp via IFTTT