This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Powershell script quit after upgraded to 2020.2

I just upgraded to 2020.2.  Post upgrade two of my SAM monitors quit working.  Both are powershell scripts that monitor age of files on a remote server.  When I edit the application and then edit the script.  I run the get output and it does not return the correct value.  If I copy the script in PowerShell ISE and run it directly on the SolarWinds orion server I get the correct value.

These scripts worked flawlessly until the upgrade today.  Has anyone had this issue after upgrading.  Here is an example of the very basic powershell script.

$fullPath = "\\servername\ILS\Interface\Input\*.*"
$numdays = 0
$numhours = 0
$nummins = 15

function ShowOldFiles($path, $days, $hours, $mins)
{
$files = @(get-childitem $path -include *.* | where {($_.LastWriteTime -lt (Get-Date).AddMinutes(-$mins)) -and ($_.psIsContainer -eq $false)})
if ($files -ne $NULL)
{
for ($idx = 0; $idx -lt $files.Length; $idx++)
{
$file = $files[$idx]
Write-Host 'Statistic: ' $file.count;
}
} else
{
Write-Host 'Statistic: ' 0;
}
}

ShowOldFiles $fullPath $numdays $numhours $nummins

Thanks,

  • Hey , same thing happened to us!  I have a script that accesses a XML file on a remote machine (but instead of using a UNC path like yours does, ours accesses it via the admin share path, but still, same thing pretty much).  As soon as we upgraded, it stopped working.  Nothing changed in the script or on the monitor, the only new thing is the version number of Orion.

    We have a case open with SW on this and I'm scheduled to talk to Support tomorrow afternoon, but I'm suspecting they made a security change to how the PowerShell script components run and it is affecting the way PowerShell accesses files.  If they can figure it out tomorrow, I'll come back here and post what happened.

  • Great!  Thank you very much.  If I hear anything I'll also post back here.

    Thanks,

  • Ughhhh that's going to put a cramp in my upgrade plans if they don't resolve it. That's one of our major use cases for SAM these days.
  • Same here, hope its a simple fix......

  • I opened a ticket yesterday and it has not be taken yet.  Really hoping someone get's a fix for it.

    Thanks,

  • Are you running this script locally via agent or agentless? Also - what account are you running it under - agent and agentless? Please try a system created folder and see if your output changes. I have run into some odd behavior involving powershell/folder checks and these suggestions came up. 

  • Great news!  It's a known issue and they already have a fix for it.  To apply the fix, the support tech simply stopped the services on all polling engines (including the primary), replaced the two DLL files on all of the polling engines with the new fixed version she provided, then restarted the services.  We then tested and the script now functions perfectly. 

    Apparently it was just what I thought;  During the upgrade they made some security change to the PowerShell component that affected how PowerShell passes creds to UNC file transfers.  

    So, if you haven't already, open a case (it's always faster if you call rather than put in a ticket online) and get a webex session setup with your support tech.  They should be able to apply the buddy drop and get you all fixed up.

  • All,

    Support provided me with the fix.  It is a known bug in this release.  There are two .dll's that they sent me.  I did the following in the readme and the scripts started working immediately upon restarting the services. 

    This BD was created to fix problem with impersonation not working for Powershell Scripts monitors.
    This BD is applicable only for SAM 2020.2

    To install this BD:

    1. Please locate and create a backup copy of the following files:

    c:\Program Files (x86)\SolarWinds\Orion\APM\SolarWinds.APM.Probes.dll
    c:\Program Files (x86)\SolarWinds\Orion\APM\SolarWinds.APM.BlackBox.IIS.Jobs.dll

    2. Extract the BD .zip files.

    3. Stop All Orion Services on all pollers
    4. Replace the original files on all pollers with the extracted files in:

    c:\Program Files (x86)\SolarWinds\Orion\APM\SolarWinds.APM.Probes.dll
    c:\Program Files (x86)\SolarWinds\Orion\APM\SolarWinds.APM.BlackBox.IIS.Jobs.dll

    5. Please right click on each DLL and go to the properties.
    6. Unblock the files if needed.
    7. Start All Orion Services again.


    To uninstall this BD:

    1. Stop All Sevices on all polling engines.
    2. Please replace the files with the originals that you backed up in step 1 of the installation.

    Hope this helps.  

    Thanks,

  • Got the .dll files after 7 days i opend a case, also referred to this topic on day 1.
     

  • I have questions! 

    1. What is a "BD"?
    2. Assuming that the security change was meant to enhance security by utilizing a new feature or parameter: does anyone know if this fix rolls back the security change, or if it actually fixes the implementation of the security feature?
    3. Is there a timeline yet for getting this rolled into a hotfix? I still haven't seen anything posted regarding this.