欲忘树 发表于 2018-9-2 13:53:08

Powershell与运维之服务器管理(二) 利用Powershell管理Dell服务器

  相比较HP ILO和OA来说,Poweshell对Dell的iDRAC管理没有这么简单,Dell没有相对于HP的管理模块。目前主要是通过Powershell3.0出现的CIM Session是来实现管理的。
  因为我的环境Dell服务器没有连接管理卡,就借助一个***贴的例子来说明:
  1用变量来存储管理卡的IP用户名和密码:
$UserName="root"  
$Password="calvin"
  

  
$DracIP="10.10.0.120"
  2 转换用户名和密码
$SecurePass = ConvertTo-SecureString $Password -AsPlainText-Force  
$DracCred = new-object -typename System.Management.Automation.PSCredential -argumentlist $UserName,$SecurePass
  3 建立一条到管理卡的CIMSession
$cimop=New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 –UseSsl  
$Dracsession=New-CimSession -Authentication Basic -Credential $DracCred -ComputerName $DracIP -Port 443 -SessionOption $cimop -OperationTimeoutSec 10000000
  4 建立Session后我们可以使用Get-Ciminstance通过传递Wsman/winrm的ResourceURI查询各种属性。
Get-CimInstance -CimSession $Dracsession -ResourceUri "  
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_SystemView
  
"
http://3.bp.blogspot.com/-yGreNj_z7qo/UkR5CRiZZoI/AAAAAAAABIU/HT66Jjrd9FM/s1600/CIM_BIOS_Info.png
  关于iDRAC的管理我这可以提供几个Dell官方的脚本工大家测试使用。


页: [1]
查看完整版本: Powershell与运维之服务器管理(二) 利用Powershell管理Dell服务器