Example Snippets
These are examples of one-liners that you can run in the terminal to get quick results.
Update Credentials of all Cisco Switches
PS C:\> $newcreds = Get-Credential
PS C:\> Get-vRNIDataSource -DatasourceType ciscoswitch | Update-vRNIDataSource -Credentials $newcreds
Disable all Data Sources
Disable all data sources of a certain type (Arista switch in this example)
PS C:\> Get-vRNIDataSource -DataSourceType aristaswitch | Disable-vRNIDataSource
Update SNMP Settings
Updates the SNMPv2 community on all Juniper switches.
PS C:\> Get-vRNIDataSource -DataSourceType juniperswitch | Set-vRNIDataSourceSNMPConfig -Enabled $true -Community "qwerty1234"
Delete a Databus Subscriber URL
PS C:\> Get-vRNIDatabusSubscriber | where {$_.url -eq "http://my-subscriber-url.local.corp/applications"} | Remove-vRNIDatabusSubscriber
Add an Application Tier
Add a new tier called web-tier to an application called My3TierApp
PS C:\> Get-vRNIApplication My3TierApp | New-vRNIApplicationTier -Name web-tier -VMFilters ("name = '3TA-Web01' or name = '3TA-Web02'")
Get all Collector Nodes
PS C:\> Get-vRNINodes | Where {$_.node_type -eq "PROXY_VM"}
Create Backup Schedule
Configure scheduled backups of once a day at 12:30 to a SSH server, and create a backup now.
PS C:\> $backupSchedule = @{ "enable" = $true; "schedule_period" = "DAILY"; "minute" = 30; "hour" = 12; "day_of_week" = 1 }
PS C:\> $sshServer = @{ "server_address" = "10.0.0.10"; "port" = 22; "username" = "backups"; "password" = "VMware1!"; "backup_directory" = "/home/backups/"; "backup_file_name" = "vrni-backup.tar" }
PS C:\> Set-vRNIBackup -RunNow $true -BackupSchedule $backupSchedule -SSHServer $sshServer
Update the CSV .zip File of a Generate Switch
Updates the generic data source information with the info from the zipfile
PS C:\> Get-vRNIDataSource | Where {$_.nickname -eq "generic-switch"} | Update-vRNIDataSourceData -Zipfile 'c:\uani-zipfile-17-11-2019.zip'