cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
231
Views
0
Helpful
1
Replies
Highlighted
Beginner

PowerShell cmdlet to set CIMC DNS server

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
Highlighted
Beginner

Re: PowerShell cmdlet to set CIMC DNS server

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

CreatePlease to create content
Content for Community-Ad
Cisco Community April 2020 Spotlight Award Winners
This widget could not be displayed.