Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Invalid use of command 'winrm'

$
0
0
Hello!
I'm new in Windows Remoting and CIM. Just trying to change some resources for practice.
So I'm sending WinRM commands from Windows 7 to a CentOS 6.4 which runs OpenWSMAN in a VirtualMachine.

The following command works fine:
winrm g http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem?CreationClassName=Linux_ComputerSystem+Name=localhost.localdomain 
-u:root -p:myPass -r:http://192.168.50.169:5985/wsman
-SkipCNcheck -SkipCAcheck -encoding:utf-8 -a:basic

Here's the Output:
CIM_ComputerSystem
    Caption = Computer System
    CommunicationStatus = null
    CreationClassName = Linux_ComputerSystem
    Dedicated = 0
    Description = A class derived from ComputerSystem that represents the single node container of the Linux OS.
    DetailedStatus = null
    ElementName = localhost.localdomain
    EnabledDefault = 2
    EnabledState = 2
    Generation = null
    HealthState = null
    InstallDate = null
    InstanceID = null
    LPARID = null
    Name = localhost.localdomain
    NameFormat = IP
    OperatingStatus = null
    OtherEnabledState = NULL
    PrimaryOwnerContact = root@localhost.localdomain
    PrimaryOwnerName = root
    PrimaryStatus = null
    RequestedState = 2
    ResetCapability = null
    Status = NULL
    TimeOfLastStateChange = null
    TransitioningToState = 12

The error appears when using the following command, which is the right syntax I think...
Want to change a property and thought the "RequestStateChange"-Method would be appropriate here, so i sent an invoke:
winrm invoke RequestStateChange http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem?CreationClassName=Linux_ComputerSystem+Name=localhost.localdomain
 -u:root -p:myPass -r:http://192.168.50.169:5985/wsman
 -SkipCNcheck -SkipCAcheck -encoding:utf-8 -a:basic @{RequestedState="3"}
But the Output is the following everytime:
Error: Invalid use of command line. Type "winrm -?" for help.

Can't find the problem, can anyone give me the solution or a working alternative to change resources/properties?
Even for a hint I'd be very thankful!

Thanks!

Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>