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