none
Powershell session for DMZ network RRS feed

  • Question

  • I try to connect WSUS server which is in DMZ and pull a list of computer names  with LastSyncTime.

    $wsus = .\PSExec \\WSUS-SERVER -u Administrator -p Administrator Powershell

    Get-WsusComputer -All | Select FullDomainName, LastSyncTime

    I get the results but when exit the wsus session I lost the arrays content. I'm not sure how to edit this code to save content of $wsus?  

    • Moved by jrv Wednesday, July 17, 2019 9:36 AM Correct forum
    Wednesday, July 17, 2019 9:09 AM

All replies

  • oved to SysInternals forum for "PsExec" issues.

    \_(ツ)_/

    Wednesday, July 17, 2019 9:39 AM
  • DId you already tried something like this?

                $erlog = "C:\Logs\" + "$(Get-Date -uformat %Y%m%d_%H%M%S)_" + $WSUS-SERVER + "_error.log"
                $outlog = "C:\Logs\" + "$(Get-Date -uformat %Y%m%d_%H%M%S)_" + $WSUS-SERVER + "_output.log"
                $arglist = "\\$WSUS-SERVER -u Administrator -p Administrator Powershell Get-WsusComputer -All | Select FullDomainName, LastSyncTime"
                write-host ("Starting Powershell on: $WSUS-SERVER") -foregroundcolor DarkGreen
                $PsExecProcess=(Start-Process -PsPath "C:\Sysinternals\psexec.exe" -Argumentlist $Arglist -RedirectStandardError $erlog -RedirectStandardOutput $outlog) 

                Write-Host($PsExecProcess)

    HTH
    -mario

    Wednesday, July 17, 2019 9:50 AM
  • I get an error for that. 

    I'm not sure if its possible to pass values back from remote session actually :(

    Wednesday, July 17, 2019 1:12 PM
  • Then why not using Powershell remote directly?

    https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/

    Do you have firewall or other mechanism to block the powershell port? DO you have any other constraint blocking you??

    HTH
    -mario

    Wednesday, July 17, 2019 1:46 PM