How to get list of VMs with no NSG attached ?

22689742 26 Reputation points
2021-01-26T14:31:56.647+00:00

Hello Team

How to list all VMs with no NSG attached ?

Thanks
Jas

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,010 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jabulani Motloung 161 Reputation points
    2021-01-26T14:52:32.767+00:00

    Hi @jassbhatti2007,

    Please see below article, Artur Brodziński has already written a PS script for NSG and also ASG.

    https://www.powershellbros.com/get-azure-virtual-machines-without-nsg-and-asg-assigned/

    Hope this helps.

    Regards

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. 22689742 26 Reputation points
    2021-01-26T17:06:41.493+00:00

    i am getting an error

    Get-AzureRmSubscription : Method 'get_SerializationSettings' in type 'Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient' from assembly 'Microsoft.Azure.Commands.ResourceManager.Common, Version=4.0.0.0,
    Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation


  2. 22689742 26 Reputation points
    2021-01-26T17:14:40.11+00:00

    i fixed above error by command Enable-AzureRmAlias -Scope CurrentUser

    But getting an error

    Get-azureRMvm : the 'get-AZVM' command was found in module az


  3. 22689742 26 Reputation points
    2021-01-26T17:57:22.383+00:00

    Thanks Team

    uninstall azurerm modules and install back fixed the issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.