Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API & Integration, DevOps,NetOps,SecOps


Updating a host record via powershell

New Member
Posts: 3
4810     0

I am trying to update a host record IPv4 address with script.

The script returns error.  Invoke-RestMethod : Unable to connect to the remote server.



$Body = @{
    "@type" = "login"
    "username" = ""
    "password" = "pass!"
} | ConvertTo-Json
$header = @{

Invoke-RestMethod -Uri "" -Method 'Post' -Body $body -Headers $header | ConvertTo-HTML

Invoke-Command -Computername '' -scriptblock {
    $oldobj = get-dnsserverresourcerecord -name "" -zonename "" -rrtype "A"
    $newobj = get-dnsserverresourcerecord  -name "" -zonename "" -rrtype "A"
    $updateip = ""
    $newobj.recorddata.ipv4address=[System.Net.IPAddress]:Smiley Tonguearse($updateip)
Set-dnsserverresourcerecord -newinputobject $newobj -oldinputobject $oldobj -zonename "" - passthru


Does my code look correct to update host x ip with a new ip.  

Re: Updating a host record via powershell

Posts: 289
4811     0

The address is stored in the host address record, not in the host record.  You will first need to locate the host address record, and update the address there.


Also the URI should be a REST endpoint, not just an IP address.  for example ''



Showing results for 
Search instead for 
Did you mean: 

Recommended for You