Files
Backup/_NDGOV_WindowsTeam/ITD.Infra-Servers-PowerShellUniversal.Test/Infra-Monitoring-Solarwinds/Add-ITDSolarwindsNode.ps1
T
Zack Meier 1d304511b8 update
2026-04-15 15:45:50 -05:00

32 lines
964 B
PowerShell

Param(
[Parameter(Mandatory = $true)]
[string[]]
$ComputerName = $null,
[ValidateSet('All Day Every Day',
'Weekdays 700 to 1800',
'All Week 500 to 2300'
)]
[string]
$SupportHours
)
$Func = {
param($C, $SwSupportHours)
Write-Verbose -Message "Add to Solarwinds" -Verbose
Import-SWDiscovery -ComputerName $C -Integration ServiceNow
Start-Sleep -Seconds 10
Write-Verbose -Message "Set Solarwinds node custom properties if parameter exists" -Verbose
If($PSBoundParameters.ContainsKey('SupportHours')){
Write-Verbose -Message "SupportHours $SwSupportHours." -Verbose
Set-SWNodeCustomProperty -ComputerName $C -Property SupportHours -Value $SwSupportHours
}
}
$ComputerName | ForEach-Object {
Invoke-Command -ComputerName itdslrwnds.nd.gov -ScriptBlock $Func -ArgumentList $_,$SupportHours -Credential $Secret:ndgov_svcitdiaasauto
}