cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1347
Views
0
Helpful
1
Replies

PowerShell cmdlet to set CIMC DNS server

ben57672
Level 1
Level 1
We're deploying new domain controllers to hundreds of sites, so I am writing a script to point the Cisco IMCs to the new domain controller. Looking for the specific PowerShell cmdlet (Cisco.IMC module) to set the preferred and alternate DNS servers in the CIMC. There are hundreds of cmdlets in the Cisco.IMC module, but I see none that look remotely close to what I need. Please let me know if you have any information on this.
1 Reply 1

slay00001
Level 1
Level 1

Please update the username and password or eliminate this line and, when you attempt to connect to the CIMC, you will have to manually enter the credentials.  Also update the Preferred and Alternate DNS servers.

 

$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList “username”,$(ConvertTo-SecureString -Force -AsPlainText “password”)
$IP=Read-Host -Prompt "Enter IP address"
Connect-Imc -Name $IP -Credential $cred
Get-ImcMgmtIf | set-imcmgmtif -DnsPreferred 99.99.99.99 -DnsAlternate 99.99.99.99 -Force
Disconnect-Imc