question

MichaelEriksson-2831 avatar image
0 Votes"
MichaelEriksson-2831 asked MichaelEriksson-2831 commented

Set-Item : The system cannot find the file specified. when trying to change MaxEnvelopeSizekb

Set-Item : The system cannot find the file specified.

When trying to run Set-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb -Value 8192

If I do a get-item -path WSMAN:\localhost* everything looks ok

WSManConfig: Microsoft.WSMan.Management\WSMan::localhost

Type Name SourceOfValue Value

System.String MaxEnvelopeSizekb 4096
System.String MaxTimeoutms 60000
System.String MaxBatchItems 32000
System.String MaxProviderRequests 4294967295
Container Client
Container Service
Container Shell
Container Listener
Container Plugin
Container ClientCertificate

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered

Are you doing this while running as administrator?

Before:
get-item -path WSMAN:\localhost*
WSManConfig: Microsoft.WSMan.Management\WSMan::localhost

 Type            Name                           SourceOfValue   Value
 ----            ----                           -------------   -----
 System.String   MaxEnvelopeSizekb                              500
 System.String   MaxTimeoutms                                   60000
 System.String   MaxBatchItems                                  32000
 System.String   MaxProviderRequests                            4294967295
 Container       Client
 Container       Service
 Container       Shell
 Container       Listener
 Container       Plugin
 Container       ClientCertificate

After:
Set-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb -Value 8192

    WSManConfig: Microsoft.WSMan.Management\WSMan::localhost
    
 Type            Name                           SourceOfValue   Value
 ----            ----                           -------------   -----
 System.String   MaxEnvelopeSizekb                              8192
 System.String   MaxTimeoutms                                   60000
 System.String   MaxBatchItems                                  32000
 System.String   MaxProviderRequests                            4294967295
 Container       Client
 Container       Service
 Container       Shell
 Container       Listener
 Container       Plugin
 Container       ClientCertificate


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

Hi,

This command works well for me. Does Get-Item -Path WSMAN:\localhost\MaxEnvelopeSizekb return the same error?

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelEriksson-2831 avatar image
0 Votes"
MichaelEriksson-2831 answered MichaelEriksson-2831 commented

Hi,

Thank you both for your answers.

Answer to the question if I run it as an administrator is, yes I do.

Answer to if I get the same error when runnig get Item is, no I don't

PS C:\windows\system32> Get-Item -Path WSMAN:\localhost\MaxEnvelopeSizekb


WSManConfig: Microsoft.WSMan.Management\WSMan::localhost

Type Name SourceOfValue Value


System.String MaxEnvelopeSizekb 4096

I also tried do do this via a Admin CMD and the winrm command, but same result

C:\windows\system32>winrm set winrm/config @{MaxEnvelopeSizekb="8192" }
WSManFault
Message
ProviderFault
WSManFault
Message = The system cannot find the file specified.

Error number: -2147024894 0x80070002
The system cannot find the file specified.

Regards

Michael

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

How about piping the object to set-item?

 Get-Item -Path WSMAN:\localhost\MaxEnvelopeSizekb | Set-Item -Value 8192
0 Votes 0 ·

I'm very thankful, but unfortunately no.... I'm started to think it must be something wrong like a bug or out server guys have messed around with permissions or security templates trying to lock it down. Since I can read the values but not manipulate them. But still, I have administrator privileges and If I can just find out what the setting is I can probably change it.

Regards

Michael

0 Votes 0 ·