PowerShell cmdlet to set CIMC DNS server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2018 07:40 AM - edited 03-22-2019 09:53 AM
- Labels:
-
Cisco User Groups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 11:09 AM
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
