Azure VM - Remove JIT using Powershell

Siddharth Krishna 91 Reputation points
2022-03-07T11:11:59.083+00:00

Hello.

How I can remove the JIT from a specific VM using Powershell in Azure.?

Remove-AzJitNetworkAccessPolicy : This seem to remove the entire policy and not from a specific VM. Any help is appreciated.

Thanks

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,376 Reputation points Microsoft Employee Moderator
    2022-03-08T00:01:41.36+00:00

    Hello anonymous user ,
    Please try out the below command to disable the JIT access on a specific VM in a specific ResourceGroup under that region
    Remove-AzJitNetworkAccessPolicy -ResourceGroupName "ResourceGroup" -Location "Location" -Name "NameOfTheVM"

    I just tested it locally by creating 2 VMs and after enabling the JIt on 2 VMs tried running the above command to disable JIT on one particular VM and it works perfectly!

    Before:
    180773-image.png

    After:

    180843-image.png

    0 comments No comments

Your answer

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