Hello,
I'm trying to run some powershell code to pull the status of AD trusts. When I run the script from powershell, from the SolarWinds server using domain admin credentials, it works.

Code below...
<#
==================================================================================
COMMENT: This script is used as a SolarWinds template to pull AD Trust info.
ARGUMENTS: NONE
==================================================================================
#>
##################
# Functions
##################
Function ExitScript
{
Write-Host "Statistic: $ReturnCode"
Write-Host "Statistic.Failed: 0"
Write-Host "Message: $Message"
Write-Host "Message.Failed: $MessageFailed"
Exit ($ReturnCode)
}
##################
# Variables
##################
$FQDN = (Get-WmiObject Win32_ComputerSystem).Domain
$TrustInfo = Get-WmiObject -Namespace "root\MicrosoftActiveDirectory" -query "Select * from Microsoft_DomainTrustStatus" -ComputerName "$FQDN"
$ReturnCode = 0
$MessageFailed = ""
##################
# Main
##################
ForEach ($Trust in $TrustInfo) {
$SourceDomain = $FQDN
$DestinationDomain = $Trust.TrustedDomain
If (!$Trust.TrustIsOk) {
$Counter++
$MessageFailed += "The domain trust between $SourceDomain and $DestinationDomain has failed`r`n"
$ReturnCode = 2
}
Else
{
$Message += "The domain trust between $SourceDomain and $DestinationDomain has succeeded`r`n"
}
}
ExitScript
When I run this same code from a powershell monitor in Solarwinds with either the SolarWinds server as the test server or the domain controller as the test server, using the same domain admin credentials in the monitor as I ran from the Solarwinds server, it doesn't pull any info back from the Get-WmiObject command, see below...

Execution mode is set to "Remote Host". "Run the script as the specified account" is also checked. I'm banging me head against the wall on this. Is there some limitation I'm coming against in SolarWinds or something I'm just doing wrong?