Category Archives: ©

Powershell script to pull all prefixes by ASN

A short script to get all prefixes from AS by number:

$ASN = Read-Host "Enter AS Number numerals"

# Replace 'API_URL' with the actual URL of the API.
$apiUrl = "https://api.bgpview.io/asn/$ASN/prefixes"

# Perform the GET request and convert the JSON response into a PowerShell object.
$response = Invoke-RestMethod -Uri $apiUrl -Method Get

# Extract the 'prefix' field from each element in the 'ipv4_prefixes' array.
$prefixes = $response.data.ipv4_prefixes | ForEach-Object { $_.prefix }

# Print the prefixes with desired format.

foreach ($prefix in $prefixes) {
    Write-Output "/ip route add dst-address=$prefix gateway=10.10.0.1 comment=AS$ASN"
}

How to change country or region on your Azure account

It might not be a common issue for everyone, but I was travelling a lot in my life, and at some point when I was in New Zealand – I happened to create an Azure account to use with my MSDN offer, and it was created in NZD. It was fine until I moved to Ireland, and now, to keep the books tidy, I wanted to change my currency to EUR.

Microsoft docos and support stand firm that this is not possible to change your billing profile residency. However, looking under the hood, it appears to be possible with some digging in and PowerShell magic.

Continue reading

ADConnect permission issues with adminCount accounts

Once I was working on migrating Azure AD Connect from one server to another. After the migration, no matter that the account had rights on the SDadmin folder, some accounts failed to be updated with an insufficient rights error.

After some digging, I found that some accounts historically have adminCount set to 1 and inheritance turned off, so to fix that, I used the following script below:

Continue reading

Error after completing configuration of the RD Connection Broker server for high availability with windows server 2019 and SQL 2016

I was set up high availability for brokers with 2019 windows server and faced this error:

Could not create the database <DatabaseName>. Please check that the broker server has access to the SQL server, the path for -DatabaseFilePath parameter exists and contains the SQL Server database file, the connection to SQL database is correct and SQL database is online. See the SQL Server and broker event log for more details.
Continue reading

How to fix no graphics displayed with remote login to IBM RSA (White Screen)

At some point, I had to remote on one of the ancient IBM Remote Supervisor Adapter II consoles, and it turned out that it was not updated since 2009. It was running an ancient version of Java KVM, so I had to do some magic to make it work due to the java security permissions.

For me, it was an error about a weak signature algorithm MD5withRSA.

IBM RSA
Continue reading