4 Operator

 • 

3K Posts

January 18th, 2020 05:00

Can you try below commands

$ip = 'x.x.x.x'
$pw = ConvertTo-SecureString 'xpassword' -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ('xuser', $pw)
$Cimop=New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 -UseSsl
$Session=New-CimSession -Authentication Basic -Credential $credential -ComputerName $ip -Port 443 -SessionOption $Cimop
$properties=@{
	CreationClassName="DCIM_SystemManagementService" ;
	SystemCreationClassName="DCIM_ComputerSystem" ;
	SystemName="srv:system" ; 
	Name="DCIM:SystemManagementService"
}
$keyInstance=New-CimInstance -ClassName DCIM_SystemString -Namespace root/dcim -ClientOnly -Key @($properties.keys) -Property $properties
$resource = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/DCIM_SystemManagementService"
$instance = Get-CimInstance -CimInstance $keyInstance -CimSession $session -ResourceUri $resource 
$params = @{
    Target         = 'System.Embedded.1'
    AttributeName  = 'ServerTopology.1#DataCenterName'
    AttributeValue = 'DCxx'
}
Invoke-CimMethod -InputObject $instance -MethodName SetAttribute -CimSession $Session -Arguments $params -ResourceUri $resource 

 

No Events found!

Top