NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

Xatosch's avatar
Xatosch
Apprentice
Mar 21, 2018

Command line shutdown since 6.9.3

Hi....

today I have updated from 6.9.2. to 6.9.3 and now I can't shutdown the device via a powershell script, I have get the message:

Invoke-RestMethod : 
403 Forbidden
Forbidden
You don't have permission to access /dbbroker
on this server.
Apache/2.2.34 (Debian) Server at sirius Port 443
In C:\Users\pixan\Documents\Computer\Scripts\sirius_off.ps1:36 Zeichen:1
+ Invoke-RestMethod -Credential $Credential -Headers $Headers -Uri $Uri ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

anyone a solution for this...

 

the script

$Hostname = "sirius"
$Username = "admin"
$Password = ConvertTo-SecureString "TopSecret" -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential($Username, $Password)
$Headers = @{ "Content-Type" = "application/x-www-form-urlencoded"; "X-Requested-With" = "XMLHttpRequest" }
$Xml = '<?xml version="1.0" encoding="UTF-8"?><xs:nml xmlns:xs="http://www.netgear.com/protocol/transaction/NMLSchema-0.9" xmlns="urn:netgear:nas:readynasd" src="dpv_1368497621000" dst="nas"><xs:transaction id="njl_id_1278"><xs:custom id="njl_id_1277" name="Halt" resource-id="Shutdown" resource-type="System"><Shutdown halt="true" fsck="false"/></xs:custom></xs:transaction></xs:nml>'
$Uri = "https://$Hostname/dbbroker"

Add-Type @"
    using System.Net;
    using System.Security.Cryptography.X509Certificates;
    public class TrustAllCertsPolicy : ICertificatePolicy {
        public bool CheckValidationResult(
            ServicePoint srvPoint, X509Certificate certificate,
            WebRequest request, int certificateProblem) {
            return true;
        }
    }
"@

[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

Invoke-RestMethod -Credential $Credential -Headers $Headers -Uri $Uri -Method Post -Body $Xml

Write-Host "done"

6 Replies

Replies have been turned off for this discussion
  • I have the exact same issue since installing 6.9.3. Permission denied on /dbbroker. I am also experiencing connection issues now with NAS Utils app for android, which worked fine before. I really need to be able to shutdown the NAS remotely, so I tried installing firmware 6.9.2 again, but I can't. It throws an unexpected error when I try that.

     

    edit:

    When I visited the admin page again to shut it down, I got the firmware install dialog after all. So I went ahead with it. 6.9.2 installed ok. I can now also once again remotely shutdown the NAS from the commandline. So it's definately a 6.9.3 issue. I will stay with 6.9.2 until this (hopefully) gets fixed.

    • Xatosch's avatar
      Xatosch
      Apprentice

      Going back to 6.9.2 was a very good idea :cattongue:

      • mdgm-ntgr's avatar
        mdgm-ntgr
        NETGEAR Employee Retired

        This sounds like it might be related to a security change in 6.9.3.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More