-
Notifications
You must be signed in to change notification settings - Fork 7
Home
Welcome to the Auvik-PowerShell-Module wiki!
PowerShell Wrapper for the Auvik API
Description: Set the URI for API access. Will set Base URI to default of https://auvikapi.us1.my.auvik.com if no option is provided.
Options: [-BaseURI <URL>]
Options: [-DC <US|EU>]
Options: [-DC <US#|EU#>]
Set the Base URI to the US2 Datacenter
Add-AuvikBaseURI -DC US2
Description: Returns the URI configured for the current session
Options: None
Description: Removes the URI from the current session
Options: None
Description: Sets a credential for use in the current session
Options: [-UserName <Auvik Username>] [-ApiKey <User API Key>]
Description: Returns the current session credential object
Options: None
Description: Removes the credential from the current session
Options: None
Description: Stores the current session Module Settings including URI and Credential for later use for the current user only.
Options: None
Description: Loads previously exported settings.
Options: None
Description: Test the current or provided credential to verify access. Returns the server response or True/False with -Quiet
Options: [-UserName <Auvik Username>] [-ApiKey <User API Key>] [-Quiet]
Options: [-Credential <Credential Object>] [-Quiet]
Description: Returns Audit Information
Options: [-ID <List of Audit IDs>]
Options: [-Tenants <List of Tenant IDs>] [-User <Match for User Name>]
[-Category <unknown|tunnel|terminal>]
[-Status <unknown|initiated|created|closed|failed>]
[-ModifiedAfter <Datestamp for earliest record>]
Description: Returns Note Information
Options: [-ID <List of Note IDs>]
Options: [-Tenants <List of Tenant IDs>] [-Entities <List of Entity IDs>]
[-EntityName <Match for Entity Name>]
[-User <Match for User Name>]
[-Type <root|device|network|interface>]
[-ModifiedAfter <Datestamp for earliest record>]
Description: Returns Interface Information
Options: [-ID <List of Interface IDs>]
Options: [-Tenants <List of Tenant IDs>] [-Devices <List of Device IDs>]
[-InterfaceType <ethernet|wifi|bluetooth|cdma|coax|cpu|firewire|gsm|ieee8023AdLag|inferredWired|inferredWireless|linkAggregation|loopback|modem|wimax|optical|other|parallel|ppp|rs232|tunnel|unknown|usb|virtualBridge|virtualNic|virtualSwitch|vlan|distributedVirtualSwitch|interface>]
[-AdminStatus <True|False|Null>]
[-OperationalStatus <online|offline|unreachable|testing|unknown|dormant|notPresent>]
[-ModifiedAfter <Datestamp for earliest record>]
Description: Returns Network Information
Options: [-ID <List of Network IDs>] [-IncludeDetailFields <scope,primaryCollector,secondaryCollectors,collectorSelection,excludedIpAddresses>]
Options: [-Tenants <List of Tenant IDs>] [-Devices <List of Device IDs>]
[-NetworkType <routed|vlan|wifi|loopback|network|layer2|internet>]
[-IncludeDetailFields <scope,primaryCollector,secondaryCollectors,collectorSelection,excludedIpAddresses>]
[-ScanStatus <true|false|notAllowed|unknown>]
[-ModifiedAfter <Datestamp for earliest record>]
Description: Returns Network Details
Options: [-ID <List of Network IDs>]
Options: [-Tenants <List of Tenant IDs>] [-Devices <List of Device IDs>]
[-NetworkType <routed|vlan|wifi|loopback|network|layer2|internet>]
[-IncludeDetailFields <scope,primaryCollector,secondaryCollectors,collectorSelection,excludedIpAddresses>]
[-ScanStatus <true|false|notAllowed|unknown>]
[-Scope <private|public>]
[-ModifiedAfter <Datestamp for earliest record>]
Description: Returns the list of tenant IDs available for the current user
Options: None
Return all tenants. Return managed devices for each tenant and return device counts for each type of device.
Import-Module AuvikAPI
If (Confirm-AuvikAPICredential -Quiet) {
$AuvikTenants = Get-AuvikTenants | Where-Object {$_.attributes.tenantType -eq 'client'}
ForEach ($tenant in $AuvikTenants) {
$TenantDevices = Get-AuvikDevicesInfo -Tenant $tenant.ID -IncludeDetailFields manageStatus
$ManagedDeviceIDs = $TenantDevices | Select-Object -ExpandProperty 'Included' -ErrorAction SilentlyContinue | Where-Object {$_.attributes.manageStatus -eq 'true'} | Select-Object -ExpandProperty 'ID' -ErrorAction SilentlyContinue
$ManagedDevices = $TenantDevices | Select-Object -ExpandProperty 'Data' -ErrorAction SilentlyContinue | Where-Object {$ManagedDeviceIDs -contains $_.ID}
$ManagedDevicesGroup = $ManagedDevices | Select-Object -ExpandProperty Attributes -ErrorAction SilentlyContinue | Group-Object -Property deviceType -AsHashTable -ErrorAction SilentlyContinue
If ($ManagedDevicesGroup) {
Write-Output "Client: $($tenant.attributes.domainPrefix)"
ForEach ($deviceType in $ManagedDevicesGroup.Keys) {
Write-Output "$deviceType,$($ManagedDevicesGroup.$deviceType.Count)"
}
}
}
}