简介
本文档介绍如何将UCS Manager或思科集成管理控制器的设备连接器重置为出厂默认设置。
先决条件
要求
Cisco 建议您了解以下主题:
- 对统一计算系统服务器(UCS)的基本了解
 
- 基本了解UCS Manager(UCSM)
 
- 基本了解思科集成管理控制器(CIMC)
 
- 对Intersight的基本理解
 
- 对Powershell的基本了解
 
使用的组件
本文档不限于特定的软件版本。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
背景信息
在尝试进行此配置之前,请确保满足以下要求。
- Intersight管理员帐户
 
- 与Intersight和UCSM或CIMC的连接
 
- 具有Powershell的计算机
 
配置
注意:在继续此过程之前,需要已安装Powershell。
 
重置独立服务器上的设备连接器
步骤1.安装CIMC库
在您的计算机中启动Powershell并运行命令:
PS /Users/admin>  Install-Module -Name Cisco.IMC
步骤2.设置IP和凭证
注意:您需要设置管理员帐户和密码。您还可以使用具有管理员权限的用户。
 
PS /Users/admin> $ip = “x.x.x.x"
PS /Users/admin> $credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "admin",$(ConvertTo-SecureString -Force -AsPlainText "PASSWORD")
PS /Users/admin> $cookie = Connect-Imc $ip -Credential $credentials | Select Cookie
PS /Users/admin> $headers = @{                                                     
>>  'ucsmcookie'="ucsm-cookie="+$cookie.cookie
>>  }
步骤3.检查云DNS并准备身份
PS /Users/admin> Invoke-WebRequest https://$ip/connector/DeviceConnections -Headers $headers -SkipCertificateCheck | Select content -Expand Content | ConvertFrom-Json | Select CloudDns                                     
您会得到如下输出:
CloudDns
--------
svc.intersight.com
将云DNS输出用于正文变量。
PS /Users/admin> $body = @{                                                        
>>     "CloudDns" ="svc.intersight.com"
>>     "ForceResetIdentity" = $true
>>     "ResetIdentity" = $true
>> }
步骤4.重置设备连接器
PS /Users/admin> Invoke-WebRequest -Method 'Put' -Uri https://$ip/connector/DeviceConnections  -Body ($body|ConvertTo-Json) -Headers $headers -ContentType "application/json" -SkipCertificateCheck
您会得到如下输出:
StatusCode        : 200
StatusDescription : OK
Content           : [
                      {}
                    ]
RawContent        : HTTP/1.1 200 OK
                    Server: webserver
                    Date: Wed, 27 Sep 2023 00:54:16 GMT
                    Transfer-Encoding: chunked
                    Connection: keep-alive
                    X-Frame-Options: SAMEORIGIN
                    Cache-Control: no-store, no-cache, max-age=0
                    Prevent…
Headers           : {[Server, System.String[]], [Date, System.String[]], [Transfer-Encoding, System.String[]], [Connection, System.String[]]…}
Images            : {}
InputFields       : {}
Links             : {}
RawContentLength  : 8
RelationLink      : {}
步骤5.断开与CIMC的连接
Disconnect-Imc 
重置UCS Manager上的设备连接器
步骤1.安装UCSM库
在您的计算机中启动Powershell并运行命令:
PS /Users/admin>  Install-Module -Name Cisco.UCSManager
步骤2.设置IP和凭证
注意:您需要设置管理员帐户和密码。您还可以使用具有管理员权限的用户。
 
PS /Users/admin> $ip = “x.x.x.x"
PS /Users/admin> $credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "admin",$(ConvertTo-SecureString -Force -AsPlainText "PASSWORD")
PS /Users/admin> $cookie = Connect-Ucs $ip -Credential $credentials | Select Cookie
PS /Users/admin> $headers = @{                                                     
>>  'ucsmcookie'="ucsm-cookie="+$cookie.cookie
>>  }
步骤3.检查云DNS并准备身份
PS /Users/admin> Invoke-WebRequest https://$ip/connector/DeviceConnections -Headers $headers -SkipCertificateCheck | Select content -Expand Content | ConvertFrom-Json | Select CloudDns                                     
您会得到如下输出:
CloudDns
--------
svc.ucs-connect.com
将云DNS输出用于正文变量。
PS /Users/admin> $body = @{                                                        
>>     "CloudDns" =“svc.ucs-connect.com"
>>     "ForceResetIdentity" = $true
>>     "ResetIdentity" = $true
>> }
步骤4.重置设备连接器
PS /Users/admin> Invoke-WebRequest -Method 'Put' -Uri https://$ip/connector/DeviceConnections  -Body ($body|ConvertTo-Json) -Headers $headers -ContentType "application/json" -SkipCertificateCheck
您会得到如下输出:
StatusCode        : 200
StatusDescription : OK
Content           : [
                      {
                        "CloudDns": "svc.ucs-connect.com",
                        "CloudDnsList": [
                          "svc-static1.intersight.com",
                          "svc.ucs-connect.com",
                          "svc-static1.ucs-connect.com",
                          "svc.intersight.com"
                        …
RawContent        : HTTP/1.1 200 OK
                    Date: Wed, 27 Sep 2023 00:33:09 GMT
                    Server: Apache
                    Strict-Transport-Security: max-age=31536000; includeSubDomains
                    Cache-Control: no-store, must-revalidate, no-cache
                    Pragma: no-cache
                    X-…
Headers           : {[Date, System.String[]], [Server, System.String[]], [Strict-Transport-Security, System.String[]], [Cache-Control, System.String[]]…}
Images            : {}
InputFields       : {}
Links             : {}
RawContentLength  : 20468
RelationLink      : {}
步骤5.断开与UCSM的连接
Disconnect-Ucs
相关信息