跳到主要內容

發表文章

目前顯示的是 9月, 2014的文章

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-SCOMNotificationSubscr

Hyper-V 計量

適用於Windows 2012 R2 Hyper-V Enable-VMResourceMetering Reset-VMResourceMetering Disable-VMResourceMetering Measure-VM –VMName Greendale-VM $report = Measure-VM –VMName Greendale-VM $report | Format-List Get-VM vm-guest-name | Enable-VMResourceMetering Get-VM vm-guest-name | Measure-VM | select * (Measure-VM -VMName vm-guest-name).NetworkMeteredTrafficReport Add-VMNetworkAdapterAcl -VMName SQL2012 -Action Meter -RemoteIPAddress 10.10.0.0/16 -Direction Outbound Parameter Set: VMName Add-VMNetworkAdapterAcl [-VMName] <String[]> -Action <VMNetworkAdapterAclAction> -Direction <VMNetworkAdapterAclDirection> [-ComputerName <String[]> ] [-LocalIPAddress <String[]> ] [-LocalMacAddress <String[]> ] [-Passthru] [-RemoteIPAddress <String[]> ] [-RemoteMacAddress <String[]> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>] Parameter Set: ManagementOS Add-VMNetworkAdapterAcl -Action <VM