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

List Autorun Services

# $cred = get-Credential -credential kdoan-a $Username = 'kimconnect\kim-Admin $Password = 'PASSWORD' $pass = ConvertTo-SecureString…

PowerShell: Try Catch Technique to Obtain Error Type

# Test try{Read-SCVirtualMachine $vmName -EA Stop}catch{$errorMessage=$error[0].Exception.GetType().FullNamewrite-host $errorMessage} # Get error type Microsoft.VirtualManager.Utils.CarmineException # Retry catch…

Basic JavaScript: Understanding Uninitialized Variables

// Initialize these three variablesvar a;var b;var c;// Do not change code below this linea…