Skip to content

Set AvmRemoteAccessConfig

Gincules edited this page Apr 4, 2023 · 1 revision

Set-AvmRemoteAccessConfig

Synopsis

Action: SetConfig
Available on: ✅ FRITZ!Box / 🚫 FRITZ!Repeater
Status: ✅
Remote access: ✅
Required rights: 🔧

Description

This function configures one user for remote access from internet.
The user will have box configuration rights from internet on success.
The argument Username may be an username or an email address.
The argument Port value must be in the ranges 1 - 65535.
A disabled user with the matching name will be enabled.
An existing user which has been used last for this service can be renamed by this action.

Input:

Data type Variable Example or Description
Boolean NewEnabled 1
Ushort NewPort 12345
String NewUsername RemoteUser
SecureString NewPassword <SecureString>

Output:

Data type Variable Example
String u urn:dslforum-org:service:X_AVM-DE_RemoteAccess:1

Syntax

Set-AvmRemoteAccessConfig
    [-Insecure]
    [-RemoteAccess]
    [-Url <String>]
    [-Port <Ushort>]
    [-Credential <PSCredential>]
    [-NewEnabled <Boolean>]
    [-NewPort <Ushort>]
    [-NewUsername <String>]
    [-NewPassword <SecureString>]

Examples

Example 1

This example describes how to run the command using a valid certificate and remote access.

[PSCredential]$Credential = Import-Clixml -Path "${env:APPDATA}\PScred\avmtools-credential.xml"
[SecureString]$NewPassword = Get-Content -Path "${env:APPDATA}\PScred\function-password.txt" | ConvertTo-SecureString

$splatParameters = @{
    RemoteAccess = $true
    Url = "https://myfritzaddress12.myfritz.net"
    Port = 443
    Credential = $Credential
    NewEnabled = 1
    NewPort = 12345
    NewUsername = "RemoteUser"
    NewPassword = $NewPassword
}

Set-AvmRemoteAccessConfig @splatParameters

Example 2

This example describes how to run the command using local connection with a valid certificate.

[PSCredential]$Credential = Import-Clixml -Path "${env:APPDATA}\PScred\avmtools-credential.xml"
[SecureString]$NewPassword = Get-Content -Path "${env:APPDATA}\PScred\function-password.txt" | ConvertTo-SecureString

$splatParameters = @{
    Url = "https://fritz.box"
    Port = 49443
    Credential = $Credential
    NewEnabled = 1
    NewPort = 12345
    NewUsername = "RemoteUser"
    NewPassword = $NewPassword
}

Set-AvmRemoteAccessConfig @splatParameters

IP address can be used instead of DNS name.

[PSCredential]$Credential = Import-Clixml -Path "${env:APPDATA}\PScred\avmtools-credential.xml"
[SecureString]$NewPassword = Get-Content -Path "${env:APPDATA}\PScred\function-password.txt" | ConvertTo-SecureString

$splatParameters = @{
    Url = "https://192.168.178.1"
    Port = 49443
    Credential = $Credential
    NewEnabled = 1
    NewPort = 12345
    NewUsername = "RemoteUser"
    NewPassword = $NewPassword
}

Set-AvmRemoteAccessConfig @splatParameters

Example 3

This example describes how to run the command using local connection without a valid certificate.

[PSCredential]$Credential = Import-Clixml -Path "${env:APPDATA}\PScred\avmtools-credential.xml"
[SecureString]$NewPassword = Get-Content -Path "${env:APPDATA}\PScred\function-password.txt" | ConvertTo-SecureString

$splatParameters = @{
    Insecure = $true
    Url = "http://fritz.box"
    Port = 49000
    Credential = $Credential
    NewEnabled = 1
    NewPort = 12345
    NewUsername = "RemoteUser"
    NewPassword = $NewPassword
}

Set-AvmRemoteAccessConfig @splatParameters

IP address can be used instead of DNS name.

[PSCredential]$Credential = Import-Clixml -Path "${env:APPDATA}\PScred\avmtools-credential.xml"
[SecureString]$NewPassword = Get-Content -Path "${env:APPDATA}\PScred\function-password.txt" | ConvertTo-SecureString

$splatParameters = @{
    Insecure = $true
    Url = "http://192.168.178.1"
    Port = 49000
    Credential = $Credential
    NewEnabled = 1
    NewPort = 12345
    NewUsername = "RemoteUser"
    NewPassword = $NewPassword
}

Set-AvmRemoteAccessConfig @splatParameters
Clone this wiki locally