Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View marckean's full-sized avatar

Marc Kean marckean

View GitHub Profile
# Like an inventory of all blobs across all storage accounts
$Subscription_IDs = @("ID_One-hf49h4h98h", "ID_Two-8f4jfj2409")
foreach ($Subscription_ID in $Subscription_IDs) {
Get-AzSubscription -SubscriptionId $Subscription_ID | Select-AzSubscription
# Retrieve all storage accounts
$storageAccounts = Get-AzStorageAccount | where { !($_.defaultToOAuthAuthentication) -and $_.AllowBlobPublicAccess -eq $true -and $_.StorageAccountName -notmatch 'cs.*' -and $_.StorageAccountName -ne 'dtaawsarchive'}
# This Sets up WinRM Remote PowerShell with delegated authentication for an existing trusted SSL cert
########################################################################
################ Do this on the Server
########################################################################
#Enable WinRM on a VM - with on-demand certificate creation
Function RemotePowerShell {
$process = 'cmd.exe'
$arguments = '/c winrm invoke restore winrm/config @{}'
<#
Written with version 1.3.0 of the Az PowerShell Module
Run Get-InstalledModule to check installed modules
Install PowerShell Core 6 https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6
The Az PowerShell Module is available from here https://github.com/Azure/azure-powershell/releases/tag/v1.4.0-February2019
... or run: Install-Module -Name Az -RequiredVersion 1.4.0 -AllowClobber
<#
Written with PowerShell v7.0.1 - install available here https://github.com/PowerShell/powershell/releases
Written with version 4.2.0 of the Az PowerShell Module
available from here https://github.com/Azure/azure-powershell/releases/tag/v4.2.0-June2020 or run: Install-Module -Name Az -RequiredVersion 4.2.0 -AllowClobber
Migration instructions Azure.RM to Az - https://azure.microsoft.com/en-au/blog/how-to-migrate-from-azurerm-to-az-in-azure-powershell/
#>
##########################################################################################
############################ Logon to Microsoft Azure #############################
##########################################################################################
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."
# Interact with query parameters or the body of the request.
$FirstName = $Request.Query.FirstName # Query based parameters
adminpassword=AdminPassword
publicserver=never
requirestreamconfigs=1
logfile=logs\sc_serv.log
w3clog=logs\sc_w3c.log
banfile=control\sc_serv.ban
ripfile=control\sc_serv.rip
portbase=8000
;Stream IDs
$RadiusServer_FQDN = "WP-DC-01.wp.local"
$RadiusServer_Extension = "IP security IKE intermediate"
$CertStoreRootPath = 'LocalMachine'
$RootCertStore = "Cert:\$CertStoreRootPath\My"
$RadiusServer_Extension1 = "Server Authentication"
$RadiusServer_Extension2 = "Client Authentication"
$VPNServer_Extension1 = 'IP security IKE intermediate'
## Radius Server
$RadiusCertificate = Get-ChildItem -Path $RootCertStore `
### RUN AS ADMINISTRATOR
# This script here string, will be copied to the local computer to be run locally
# Change the variables in this script, they are at the top in this here string
$script = @'
# Replace with your Workspace ID
$LogAnalyticsCustomerID = "Workspace ID"
# Replace with your Log Analytics workspace Primary Key
$LogAnalyticsPrimaryKey = "workspace Primary Key"

The following is an index of all documents from the APS Sentral site.

Note: For the links to work, you'll need to first logon to the main Sentral site itself. This is in order for the browser to download the cookie/s needed to authenticate.

TIP: so you can come back to this page after logging onto the main Sentral site, open this link in a new tab:

  • In Windows hold down the CTRL key while clicking the link
  • On a Mac, hold down the COMMAND key while clicking the link
  • On a phone, hold down on the link and choose from the menu to open in a new tab

You only have to logon once to the the main Sentral site. Once logged on to the the main Sentral site, come back to this page, the links below will work.

### Log into Azure ARM
Login-AzureRmAccount
### Choose subscription 'new' Azure
$subscription = (Get-AzureRmSubscription | Out-GridView -Title "Select the Azure subscription that you want to use ..." -PassThru).SubscriptionName
Select-AzureRmSubscription -SubscriptionName $subscription
Import-Module "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Network\AzureRM.Network.psd1"
##########################################################################