Hey 5ghz,
Is it the same details against every network you use. I'm not a native programmer either but like tinkering happy to snap something together that will allow you to do your updates.
quick one just to show how to get all your networks against all your orgs
These utilise GET commands so only reading data not writing.
#### make sure powershell runs script as tls1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$apikey = "ENTER YOUR API KEY IN HERE"
$header = @{
"X-Cisco-Meraki-API-Key" = $apikey
"Content-Type" = 'application/json' }
## Define the tables for storing devices used later ##
$networklist_all = @()
$resourceOrgs = "https://api.meraki.com/api/v0/organizations"
$resultOrgs = Invoke-RestMethod -Uri $resourceOrgs -Method GET -Header $header
ForEach ($Org_Meraki in $resultOrgs) {
$FindOrgid = $Org_Meraki.id
$FindOrgName = $Org_Meraki.name
$GetNetworks = "https://api.meraki.com/api/v0/organizations/$FindOrgid/networks/"
Try {
$resultGetNetworks = Invoke-RestMethod -Uri $GetNetworks -Method GET -Headers $header
}
catch [System.Net.WebException] {
$Request = $_.Exception
Write-Warning "No Networks In This Organisation '$FindOrgName'"
Continue
}
$resultGetNetworksSorted = $resultGetNetworks | Sort-Object name
ForEach ($Network_Meraki in $resultGetNetworksSorted) {
$Selected_network = New-Object psobject
$Selected_network | Add-Member -MemberType NoteProperty -Name id -Value $Network_Meraki.id
$Selected_network | Add-Member -MemberType NoteProperty -Name name -Value $Network_Meraki.name
$Selected_network | Add-Member -MemberType NoteProperty -Name timeZone -Value $Network_Meraki.timeZone
$Selected_network | Add-Member -MemberType NoteProperty -Name tags -Value $Network_Meraki.tags
$Selected_network | Add-Member -MemberType NoteProperty -Name type -Value $Network_Meraki.type
$Selected_network | Add-Member -MemberType NoteProperty -Name disableMyMerakiCom -Value $Network_Meraki.disableMyMerakiCom
$Selected_network | Add-Member -MemberType NoteProperty -Name disableRemoteStatusPage -Value $Network_Meraki.disableRemoteStatusPage
$Selected_network | Add-Member -MemberType NoteProperty -Name OrgName -Value $FindOrgName
$networklist_all+=$Selected_network
}
}
$networklist_all