Chirag Nagrekar has Published 394 Articles

How to list the azure VM extensions using Azure CLI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:33:47

1K+ Views

To list all the azure VM extensions using Azure CLI, we can use the “az vm extension” command.Before running this command make sure you are connected with the Azure cloud account and the Azure subscription. Once we run the command for the extension we need to provide the VM name ... Read More

How to get all the available azure VM images using Azure CLI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:31:52

2K+ Views

To get all the available azure VM images using Azure CLI, you can use the command az vm image.The below command will retrieve all the available azure images in the marketplace.PS C:\> az vm image list --allThe above command will take some time to retrieve the output. To get the ... Read More

How to restart the Azure VM using Azure CLI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:27:17

3K+ Views

To restart the Azure VM using PowerShell, we can use the az vm restart command. This command requires the Azure VM in the running status. You also require to connect to the Azure cloud account and the proper azure subscription before running this command.Let assume our VM win2k16vm1 is currently on. ... Read More

How to stop the Azure VM using Azure CLI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:25:49

4K+ Views

To stop the azure VM using Azure CLI we can use the az vm stop command. Before running this command make sure that you are connected to the Azure account and the proper Azure subscription.When we run this command, we need to provide the Azure VM name (-n) and the ... Read More

How to start the Azure VM using Azure CLI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:24:30

1K+ Views

To start the stopped Azure VM using Az CLI, we can use the az vm start command. Before starting the azure VM, make sure that you are connected to the desired subscription and the Azure cloud account.To start the specific VM, we will use the command below.PS C:\> az vm start ... Read More

How to deallocate the Azure VM using Azure CLI in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:22:59

3K+ Views

To deallocate the Azure VM using Azure CLI, we need to use the VM deallocation command az vm deallocate and need to provide the name of the VM and the resource group of the VM.Before running the deallocation command, make sure that you are connected to the proper azure subscription ... Read More

How to connect to SSH using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:21:19

8K+ Views

It is possible to connect the non-windows target machines with the PowerShell using the SSH command in PowerShell. For that, you need to use the below format.ssh username@servernameThe below example shows how we can connect the non-windows target machine.PS C:\> ssh ansible@192.168.0.104OutputOnce you run this command the first time for ... Read More

How to delete the windows certificate using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:20:06

8K+ Views

To delete the Windows certificate using PowerShell, we can use the Remove-Item command.Suppose you know the thumbprint of the certificate then to retrieve all the certificates that use that particular thumbprint, we will use the below command.PS C:\> gci cert:\ -Recurse | where{$_.Thumbprint -eqOutputTo remove the certificates, we will pipeline ... Read More

How to retrieve the Azure VM network security group (NSG) using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:18:54

1K+ Views

To retrieve the Azure VM NSG name using PowerShell, we first need to retrieve the NIC name of the VM.PS C:\> $vm = Get-AzVM -VMName Win2k16VM1 PS C:\> $vmnic = $vm.NetworkProfile.NetworkInterfaces.Id.Split('/')[-1]The above command will retrieve the name of the VM. To get the network security Group (NSG) name, we can ... Read More

How to retrieve the Azure VM deallocated date using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 02-Sep-2021 11:16:56

1K+ Views

To get the Azure VM deallocated date using PowerShell we can use the below command.PS C:\> Get-AzVM -VMName Win2k16VM1 -ResourceGroupName TestVMRG -StatusHere it will retrieve the PowerState of the VM.To retrieve the date when the VM was deallocated, we need to filter out the result.PS C:\> $vm = Get-AzVM -VMName ... Read More

Advertisements