Wyłącz odnajdywanie zakresów IPv4 serwera DHCP
Microsoft.Windows.DHCPServer.10.0.Tasks.DisbaleDHCPScopesDiscovery (Task)
Element properties:
Member Modules:
Source Code:
<Task ID="Microsoft.Windows.DHCPServer.10.0.Tasks.DisbaleDHCPScopesDiscovery" Accessibility="Internal" Target="Microsoft.Windows.DHCPServer.10.0.Group.IPv4Scopes" Enabled="true" Timeout="300" Remotable="true">
<Category>Custom</Category>
<ProbeAction ID="PA" TypeID="Microsoft.Windows.DHCPServer.10.0.DisbaleDHCPScopesDiscoveryProbe" RunAs="System!System.PrivilegedMonitoringAccount">
<ScriptName>Microsoft.Windows.Server.10.0.DisbaleScopeRulesMonitors.Script.ps1</ScriptName>
<ScriptBody><Script>
param([parameter(Mandatory=$true)] $ManagementPackID,$TargetComputerFQDN)
try
{
$MP = Get-SCOMManagementPack -Name $ManagementPackID | where {$_.Sealed -eq $False}
if($MP -eq $null)
{
Write-Host "Please provide a valid un-sealed Mangement Pack ID"
Exit
}
if([string]::IsNullOrEmpty($TargetComputerFQDN) -ne $true)
{
$TargetComputerFQDN = $TargetComputerFQDN.Trim()
$Instance = Get-SCOMClass -Name "Microsoft.Windows.DHCPServer.Library.Server" | Get-SCOMClassInstance | Where-Object {$_.DisplayName -like "*$TargetComputerFQDN*"}
}
$start = 0
$end = 10
for($i = 0;$i -lt 10;$i++)
{
$name = "Microsoft.Windows.DHCPServer.10.0.Scopes.WithPagingDiscovery"+$start+"to"+$end+"PercentScopes"
$Discovery = Get-SCOMDiscovery -Name $name
if($Discovery -ne $null)
{
if([string]::IsNullOrEmpty($Instance))
{
$Override = Get-SCOMOverride -Discovery $Discovery | Where-Object {$_.ContextInstance -eq $null}
if([string]::IsNullOrEmpty($Override))
{
Disable-SCOMDiscovery -Discovery $Discovery -ManagementPack $MP
}
else
{
Write-Host $Discovery.DisplayName"is already overridden in"$Override.Identifier.Domain"Management Pack"
}
}
else
{
$OverrideInstance =Get-SCOMOverride -Discovery $Discovery -Instance $Instance
if([string]::IsNullOrEmpty($OverrideInstance))
{
Disable-SCOMDiscovery -Discovery $Discovery -ManagementPack $MP -Instance $Instance
}
else
{
Write-Host $Discovery.DisplayName"is already overridden for"$Instance.DisplayName"in"$OverrideInstance.Identifier.Domain"Management Pack"
}
}
}
else
{
Write-Host "Discovery $name Does not exists"
}
$start= $end
$end = $end + 10
}
Write-Host "Success"
}
catch [System.Exception]
{
$Description = $_.ToString()
Write-Warning "$Description"
}
</Script></ScriptBody>
<ManagementPackID>ManagementPackID</ManagementPackID>
<TargetComputerFQDN/>
<TimeoutSeconds>300</TimeoutSeconds>
</ProbeAction>
</Task>