Unsolved
This post is more than 5 years old
1 Message
0
1570
January 16th, 2020 10:00
set idrac location with powershell and wsman
i'm trying to update the datacenter location property of my idracs via powershell and wsman, and i'm struggling with cim commands. the documentation i'm using is linked below as well as a portion of my script. any help is appreciated. right now i'm just getting Invoke-CimMethod : An internal error occurred when the invoke-cimmethod command runs. I don't understand the new cim instance bit.
I can use the DCIM_SystemString to get the information, but changing it is not intuitive for me. The operations section (7.4.2) of the linked DCIM library document for DCIM_SystemStrings lists: DCIM_SystemManagementService.SetAttributte(). Am I supposed to create an instance of the DCIM_SystemManagementService class to alter the SystemStrings class? I tried that too, and got an error that the request contained invalid selectors for the instance.
Using Microsoft™ Windows® PowerShell CIM Cmdlets with Dell™ iDRAC
Dell DCIM library for System Info Profile - specifically systemstring on page 22
$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=@{InstanceID='System.Embedded.1#ServerTopology.1#DataCenterName';}
$instance = New-CimInstance -ClassName DCIM_SystemString -Namespace root/dcim -ClientOnly -Key @($properties.keys) -Property $properties
$params = @{
Target = 'System.Embedded.1'
AttributeName = 'ServerTopology.1#DataCenterName'
AttributeValue = 'DCxx'
} # $params = @{
Invoke-CimMethod -InputObject $instance -MethodName SetAttribute -CimSession $Session -Arguments $params
i tried changing the properties and instance variables, but go the invalid selectors for the resource error. that change is below.
$properties=@{SystemCreationClassName='DCIM_ComputerSystem'; CreationClassName='DCIM_SystemManagementService'; SystemName='srv:system'; Name='DCIM:SystemManagementService'; ElementName='System Management Service'}
$instance = New-CimInstance -ClassName DCIM_SystemManagementService -Namespace root/dcim -ClientOnly -Key @($properties.keys) -Property $properties
any help is appreciated.


DELL-Shine K
6 Operator
•
3K Posts
0
January 18th, 2020 05:00
Can you try below commands