Post by Arno WelzelJa, das Protokoll wird nicht dauerhaft gespeichert und ist bei einem
Stromausfall weg.
Okay, blöd. Ich habe mir deshalb ein PowerShell-Skript geschrieben
(getestet unter PowerShell 5.1.17763.316 mit einer Fritzbox 7590),
um das Log zur längerfristigen Speicherung abzurufen. Vielleicht
interessiert's ja jemanden:
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true };
$GetSecurityPort = @{
Service = 'DeviceInfo:1';
URL = '/upnp/control/deviceinfo';
Action = 'GetSecurityPort';
Secure = $false;
};
$GetDeviceLog = @{
Service = 'DeviceInfo:1';
URL = '/upnp/control/deviceinfo';
Action = 'GetDeviceLog';
Secure = $true;
};
function Execute-SoapRequest( $Type ) {
$query = "
<Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope/' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<Body>
<u:$( $Type.Action ) xmlns:u='urn:dslforum-org:service:$( $Type.Service )' />
</Body>
</Envelope>";
[xml] $query | Out-Null; # Check well-formedness
$port = switch( $Type.Secure ) {
$true { ( Execute-SoapRequest $GetSecurityPort ).Envelope.Body.GetSecurityPortResponse.NewSecurityPort; }
$false { '49000'; }
};
$protocol = switch( $Type.Secure ) {
$true { 'https'; }
$false { 'http'; }
};
$credentials = switch( $Type.Secure ) {
$true {
$password = ConvertTo-SecureString '******************************' -AsPlainText -Force;
@{ Credential = [pscredential]::new( 'dslf-config', $password ) } };
$false { @{}; }
}
$response = Invoke-WebRequest -Uri "$( $protocol )://fritz.box:$( $port )$( $Type.URL )" -UseBasicParsing -Headers @{
'Content-Type' = 'text/xml; charset="utf-8"';
'SoapAction' = "urn:dslforum-org:service:$( $Type.Service )#$( $Type.Action )";
} -Method Post -Body $query @credentials;
return [xml] [System.Text.Encoding]::UTF8.GetString( $response.RawContentStream.ToArray() );
}
( Execute-SoapRequest $GetDeviceLog ).SelectSingleNode('//NewDeviceLog').InnerText;
--
<http://schneegans.de/computer/safer/> · SAFER mit Windows