
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get Application Security Groups of Azure VM Using PowerShell
To get the Application security groups of the Azure VM using PowerShell, we need to first get the Network Interface of the Azure VM.
The below command will retrieve the NIC name of the Azure VM.
PS C:\> $vm = Get-AzVM -Name TestVM $nic = (($vm.NetworkProfile.NetworkInterfaces.id).Split('/'))[-1]
Once we have the NIC name, we can use the Get-AzNetworkInterface command to retrieve the NIC information and the Security group.
The below command will retrieve the application security group names using PowerShell.
PS C:\> $nicsettings = Get-AzNetworkInterface -Name $nic $nicsettings.IpConfigurations.ApplicationSecurityGroups
Advertisements