Chirag Nagrekar has Published 468 Answers

How to get the IIS Application Pool Recycle settings using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 28-Apr-2021 13:38:50

To get the IIS application Pool to recycle settings using GUI, you need to check the Application pool advanced settings.To retrieve the above settings using PowerShell, we can use the Get-IISAppPool command with the specific application pool name. We have the application pool, DefaultAppPool and we need to retrieve its ... Read More

How to get the IIS Application Pool failure Settings using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 28-Apr-2021 13:38:08

Using GUI from the IIS Manager, you can get the Application Pool Failure settings using App pool advanced settings from the Rapid-Fail Protection section as shown below.To retrieve the above settings using PowerShell, (Get-IISAppPool -Name DefaultAppPool).failureTo run the above command we need the IISAdministration module. You can retrieve the same ... Read More

How to get the IIS Application Pool queue length using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 28-Apr-2021 13:37:43

From the GUI, to retrieve the Application Pool queue length you need to check the Advanced Settings of the Application Pool.To get the IIS application Pool queue length using PowerShell, first, we need to the application pool name. There are two ways (and maybe others) to retrieve once we have ... Read More

How to retrieve the Operating system of the Azure VM using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:19:28

To retrieve the OS details of the Azure VM, we need to use the Get-AzVM command.ExampleGet-AzVM -VMName TestMachine2k16When you run the above command, it retrieves the VM TestMachine2k16 information and there is an OSType property which shows that if the VM’s OS is Linux or Windows, or any other type.But ... Read More

How to delete the Azure Resource Group using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:16:22

To delete the azure resource group using PowerShell, we need to use the Remove-AZResourceGroup command. But before using this command, make sure that no usable resources exist in the resource group that you want to delete.To check if the resources are available in the resource group, use the below command. ... Read More

How to Export the Azure VMs using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:16:03

To export the azure VMs using PowerShell, we first need to get their desired properties. The cmdlet Get-AZVM will get all the VMs connected to the particular subscription. To export them to the CSV file we can use the below command.ExampleGet-AzVM | Export-Csv .\AZVMs.csv -NoTypeInformationOnce you run the above command, ... Read More

How to create a new Azure resource group using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:15:46

Azure Resource Group is a container that stores the resources like Virtual Machines, Storage, IP addresses, etc. To create a new Azure Resource group, we need to use the New-AZResourceGroup command.To use this cmdlet, you first need to connect to the Azure account, and then if you want to create ... Read More

How to get the azure resources from the resource group using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:11:36

To get the available resources from the resource groups using PowerShell, we need to use the Get-AZResource command. Suppose we have the resource group name AnsibleTestRG and we need to retrieve the resources from the resource group, then we will use the below command.ExampleGet-AzResource -ResourceGroupName AnsibleTestRGTo filter the output, OutputGet-AzResource ... Read More

How to check if the Azure resource group is empty or not using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:10:50

To check if the resource group is empty or not we need to check if the resource group contains any resources.For this example, We have a resource group name called  the TestRG and we need to check if it is empty.Example$resources = Get-AzResource -ResourceGroupName TestRG if($resources){"Resource group is not empty"} else{"Resource group is empty"}OutputResource group is emptyTo check if the resource ... Read More

How to create a temporary file using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 12-Apr-2021 11:10:28

To create a temporary file with the PowerShell, we can use the New-TemporaryFile command. This command creates a temporary file tmp<NNNN>.tmp where NNNN represents the random hexadecimal number.ExamplePS C:\> New-TemporaryFile Directory: C:\Users\Administrator.AUTOMATIONLAB\AppData\Local\Temp Mode                LastWriteTime         Length Name ----       ... Read More

Advertisements