Get-md5hash not working on remote server

Hello,
im not able to receive md5 hash on big files (1.5GB) via scriptblock.

$blok = {

function get-hash
{
 $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
 return $hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($_.fullname)))
}
get-childitem f:\data_protector_7_0 -Recurse -force |?{!$_.Psiscontainer}| select fullname ,@{n="Hash";e={$_ |get-hash}}
}

I receive only Fullname, hash property is empty

FullName : F:\data_protector_7_0\ESD_HP_DP_7.00_for_Windows_TD586-15003.01.zip
Hash     :

When I run the code locally on server, it works fine

The code itself is working remotely, I can receive hash keys on other files with no problem
G:\log\110829081433share69974.txt          46-1D-E2-6F-28-E5-F1-BC-F3-96-11-5F-7B-EC-A6-B9
G:\log\110829081433vysledekGroup69974.csv  C5-A8-E8-50-5A-72-88-98-97-43-B7-F2-E8-77-3A-71

Only have issue with these big files.  Its like getting OutOfMemory exception without any error.

Same issue occur, when I run the code via enter-pssession ... still not working on these big files.

I need to check validity on some ZIP files.

Server1: (good)
Name           : ESD_HP_DP_7.00_for_Windows_TD586-15003.01.zip
Length         : 1692480938
00-38-7B-7C-9D-A1-2C-43-5F-AB-31-6E-1A-9C-5D-8B

Server2 (bad)

Name           : ESD_HP_DP_7.00_for_Windows_TD586-15003.01.zip

Length         : 1692480938

96-9B-B3-37-3F-59-D2-49-19-D8-CB-25-97-D1-1E-80




  • Edited by Mekac Monday, February 16, 2015 11:00 AM
February 16th, 2015 1:37pm

Well, 16GB on remote session is quite OK for a file server.

And yet, the script was working fine (no obvious errors in the script, because it is working for smaller files... please)

Why should i increase RAM on remote server, when i can run this script directly on remote server, but cannot do it via PSSession?  Does remoting have increased memory requirements or what?


  • Edited by Mekac Monday, February 16, 2015 2:59 PM
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 5:59pm

winrm get winrm/config/winrs Winrs MaxMemoryPerShellMB = 150

winrm set winrm/config/winrs `@`{MaxMemoryPerShellMB=`"2048`"`}
Winrs
    MaxMemoryPerShellMB = 2048

Script is working fine now. Thx Jrv


  • Marked as answer by Mekac Tuesday, February 17, 2015 7:16 AM
  • Edited by Mekac Tuesday, February 17, 2015 7:17 AM
February 17th, 2015 10:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics