Propriedade IntervaloemSegundos de ProvedordeDescoberta para Regra do SPHA (Analisador de Estado do SharePoint). A frequência em segundos com que essa Descoberta será executada; deve ser longa o bastante para evitar falha de descoberta devido a recursos conflitantes.
SyncTime
string
$Config/SyncTime$
TempoSinc
Propriedade TempoSinc (hora de início) do ProvedordeDescoberta para Regra do SPHA (Analisador de Estado do SharePoint). TempoSinc é um valor de cadeia de caracteres no formato “HH:mm”. A hora de TempoSinc, IntervaloemSegundos e Importação de Pacote de Gerenciamento, juntos, determina o tempo de execução exato de um fluxo de trabalho específico. Por exemplo, se IntervaloemSegundos = 21600 (6 horas) e TempoSinc = "01:15", o tempo de execução possível do fluxo de trabalho será 1:15AM, 7:15AM, 1:15PM, 7:15PM; se o Pacote de Gerenciamento for importado após 1:15AM, mas antes de 7:15AM, ele começará às 7:15AM; se o Pacote de Gerenciamento for importado após 1:15PM, mas antes de 7:15PM, ele começará às 7:15PM. Entretanto, devido a outros fatores – por exemplo, atraso de rede – a hora de início real ainda poderá variar.
TimeoutSeconds
int
$Config/TimeoutSeconds$
TempoLimiteemSegundos
Propriedade TempoLimiteemSegundos de ProvedordeDescoberta para Regra do SPHA (Analisador de Estado do SharePoint). O valor TempoLimite deve ser longo o bastante para a conclusão da Descoberta do objeto necessário. Deve ser menor que IntervaloemSegundos.
DebugTrace
bool
$Config/DebugTrace$
RastreamentodeDepuração
Propriedade RastreamentodeDepuração do Provedor de Descoberta de Regra do SPHA (Analisador de Estado do SharePoint). O módulo Descoberta gravará o rastreamento de depuração no Log de Eventos do Windows se este valor estiver definido como verdadeiro.
Source Code:
<DataSourceModuleType ID="Microsoft.SharePoint.2013.SPHARule.DiscoveryProvider" Accessibility="Internal" RunAs="WSS!Microsoft.SharePoint.AdminAccount">
<Configuration>
<xsd:element name="ComputerName" type="xsd:string"/>
<xsd:element name="IntervalSeconds" type="xsd:integer"/>
<xsd:element name="SyncTime" type="xsd:string"/>
<xsd:element name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element name="DebugTrace" type="xsd:boolean"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
<OverrideableParameter ID="DebugTrace" Selector="$Config/DebugTrace$" ParameterType="bool"/>
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="Microsoft.SharePoint.2013.CommandExecuterDiscoveryDataSource">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
<ApplicationName/>
<WorkingDirectory/>
<CommandLine>powershell.exe -NoLogo -NoProfile -Noninteractive "$ep = get-executionpolicy; set-executionpolicy remotesigned; & '$file/WSSBPADiscovery.ps1$' '$MPElement$' '$Target/Id$' '$Config/ComputerName$' '$Config/DebugTrace$'</CommandLine>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>WSSStrings.ps1</Name>
<Contents><Script>$global:EventLog_Fail_Create_Discovery_Package = "Failed to create Discovery transmission package.";
$global:EventLog_Fail_Return_Discovery_Package = "Failed to return Discovery transmission package.";
$global:EventLog_Fail_Create_Discovery_ScriptAPI = "Failed to initiate MOM.ScriptAPI object.";
$global:EventLog_Fail_Create_Class = "Failed to create {0} class instance.";
$global:EventLog_Fail_Create_Relationship = "Failed to create {0} relationship instance.";
$global:EventLog_Fail_LoadBalancer_Operation = "Addresses for this application may not have been fetched yet.";
$global:EventLog_Exit_On_NonExist = "This machine does not have SharePoint installed."
$global:EventLog_Fail_On_Error = "{0} Discovery/Monitoring script continues under this error! ";
$global:EventLog_Exit_On_Error = "{0} Discovery/Monitoring script was terminated! ";
$global:EventLog_Template = "[{0} in Discovery/Monitoring script] {1} {2}";
$global:EventLog_Debug_StartedArgs = "[Debug] {0} Started. Args[]={1}, {2}, {3}, {4}.";
$global:EventLog_Debug_MajorServer = "[Debug] This is the major server detected by {0}.";
$global:EventLog_Fail_Identify_Farm = "Cannot identify which SharePoint farm this server is associated with. Check the management pack guide for troubleshooting information.";
$global:EventLog_Fail_Retrieve_Farm_And_Local = "Failed on retrieving information for SharePoint farm and Sharepoint local machine. Check the management pack guide for troubleshooting information.";
$global:EventLog_Fail_Retrieve_OM_Value = "Failed on retrieving values from SharePoint object model.";
$global:EventLog_Fail_Retrieve_Service = "Failed on retrieving {0} service from SharePoint farm {1}.";
$global:EventLog_Fail_Retrieve_Object = "Failed to find {0} in SharePoint object model.";
if ($MainServer)
{
if ($global:Debug) { $global:EventLog_Debug_MajorServer -f $MyInvocation.MyCommand }
.\WSSBPARuleDiscovery.ps1
}
}
</Script></Contents>
</File>
<File>
<Name>WSSBPARuleDiscovery.ps1</Name>
<Contents><Script>$HealthRuleQuery = new-object Microsoft.SharePoint.SPQuery
$HealthRuleQuery.ViewFields = "<FieldRef Name='Title'/><FieldRef Name='HealthRuleScope'/><FieldRef Name='HealthRuleCheckEnabled'/><FieldRef Name='HealthReportCategory'/><FieldRef Name='HealthRuleType'/><FieldRef Name='HealthRuleSchedule'/><FieldRef Name='HealthRuleService'/><FieldRef Name='HealthRuleAutoRepairEnabled'/>"
$HealthRuleQuery.Query = "<Where><Eq><FieldRef Name='HealthRuleCheckEnabled'/><Value Type='String'>1</Value></Eq></Where>"
$HealthRules = [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local.HealthRules
if (!$HealthRules)
{
$ErrMsg = @"
Error in {0}:
Failed to get SharePoint Health Rules.
Make sure user {1} have enough permission or SharePoint is configured correctly and the database server is running.
Other issues might also cause this failure. Please see Microsoft SharePoint Foundation 2013 Management Pack Guide.docx for more information.
"@ -f $MyInvocation.MyCommand, [Environment]::UserName
$EventObject.WriteEntry($ErrMsg, [System.Diagnostics.EventLogEntryType]::Warning)
break;
}
$HealthRules = $HealthRules.GetItems($HealthRuleQuery)
Handle-Errors("Error loading Microsoft SharePoint Foundation 2013 HealthRules.")
if (!$HealthRules)
{
break
}
$SPHARuleSubGroupNames = @( "Scope: Run on Any Server", "Scope: Run on All Servers" )
$SPHARuleSubGroupLocNames = @{}
$SPHARuleSubGroupLocNames["Scope: Run on Any Server"] = [Microsoft.SharePoint.Administration.Health.SPHealthAnalyzer]::GetLocalizedScope([Microsoft.SharePoint.Administration.Health.SPHealthCheckScope]::Any)
$SPHARuleSubGroupLocNames["Scope: Run on All Servers"] = [Microsoft.SharePoint.Administration.Health.SPHealthAnalyzer]::GetLocalizedScope([Microsoft.SharePoint.Administration.Health.SPHealthCheckScope]::All)
foreach ($SPHARuleSubGroupName in $SPHARuleSubGroupNames)
{