Posted On March 30, 2019

Resolve Error: (59) An unexpected network error occurred

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Resolve Error: (59) An unexpected network error occurred
Prerequisites:
  Ensure the the target machine has PowerShell Remoting Enabled (as it's Disabled by default)

PS C:\Users\kimconnect\Desktop\Notes> Enable-PSRemoting -Force
WinRM has been updated to receive requests.
WinRM service type changed successfully.
WinRM service started.
WinRM has been updated for remote management.
WinRM firewall exception enabled.

Alternative method:
a. Get PSExec: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec > extract copy contents into %windir% or "C:\Windows"

b. Run this command:
psexec \\hdqfswp001 reg add “HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters” /v SessTimeout /t REG_DWORD /d 3600 /f

Add this registry key to increase File Session Timeout:

$serverName="FILESERVER01"
Invoke-Command -ComputerName $serverName -ScriptBlock {reg add “HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters” /v SessTimeout /t REG_DWORD /d 3600 /f }

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Linux: How to Display the SSL Certificate of a Remote Server URL

Command: server=test.kimconnect.comecho | openssl s_client -showcerts -servername $server -connect $server:443 2>/dev/null | openssl x509 -inform…

PowerShell: Enable TLS 1.2 on legacy servers

# Enable TLS 1.2 on legacy servers function enableTls12{ $windowsVersionNumber=[System.Environment]::OSVersion.Version.Major; #$windowsName=(Get-CimInstance -ClassName Win32_OperatingSystem).Caption; #The term…

PowerShell: Export Event Logs by a Certain Date Range

# User defined variables $daysLimit=7 $startdate=(get-date).adddays(-$daysLimit) $computername=$env:computername $logName='Application' $filterTypes='Error','Warning' $logPath="c:\temp\eventlogs-from-$($startdate.tostring('yyyy-MM-dd'))-to-$((get-date).tostring('yyyy-MM-dd')).csv" # Get the event logs…