Forum Discussion

Clifra_Jones's avatar
Clifra_Jones
Copper Contributor
Nov 17, 2020

CIMCmdlet Module Issues

I'm working with the new CIM cmdlets for remote management and I am having odd issues.

I have configured my server to use WinRM over HTTPS with a self signed certificate. This was working when I 1st set it up. 

Today I was working on a Documentation script to document my servers. I was prototyping the commands in a 5.1 command window. 

 

Commands:

 

 

$CIMSessionOPtions = New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -UseSSL
$CimSession = New-CimSession -ComputerName '*********' -SessionOption $CIMSessionOptions
New-CimInstance -CimSession $CIMSession -ClassName Win32_ComputerSystem

 

 

This worked for the specified server. When I started debugging my script in VS Code the above Win32_ComputerSystem command failed. I went back to the 5.1 host window and it succeeded.

So I opened a new PS 7 window and tried the same commands and it also failed.

At 1st I was getting a 0x80041035 error

So I go back to my 5.1 windows and now the same command fails with:

 

 

New-CimInstance : The WS-Management service cannot process the request. The WMI service reported that the WMI provider
could not perform the requested operation.

 

 

Close everything reboot my workstation and now both PowerShell 5.1 and PowerShell 7 get the same error.

 

Very frustrating. I also restarted the WMI and WinRM service on the target server. No joy! That is about all I can do on the server as it is a production SQL server.

 

1 Reply

  • Clifra_Jones's avatar
    Clifra_Jones
    Copper Contributor
    Never mind. Sometimes I am an idiot! I stupidly transposed New-CimInstance for Get-CimInstance. Get-CimInstance is the proper CmdLet~

Resources