
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
Found 2039 Articles for Microsoft Technologies

1K+ Views
To get the installed Azure VM extension using PowerShell, we can use the Get-AzVmExtension command and we need to provide VM name and the resource group name in the command.$vm = Get-AzVM -Name TestVM Get-AzVMExtension -VMName $vm.Name -ResourceGroupName $vm.ResourceGroupNameThe above command will retrieve all the extensions in detail of the VM named TestVM. To retrieve the extension name,Get-AzVMExtension -VMName $vm.Name -ResourceGroupName $vm.ResourceGroupName | Select NameOutput

678 Views
To get the azure disk caching settings using PowerShell, we first need to retrieve the VM information using the Get-AzVM command. Before running this command, make sure that you are connected to the Azure account (Connect-AzAccount) and the proper subscription (Set-AzContext).In this example, we have a TestVM.$vm = Get-AzVM -Name TestVMWe will use the StorageProfile property and OSdisk sub-property to get the encryption settings.PS C:\> $vm.StorageProfile.OsDisk.CachingOutputTo retrieve the caching settings on all the Azure VMs from the specific subscription, we can use the below command.Get-AzVM | Select Name, ResourceGroupName, @{N='Caching';E={$_.StorageProfile.OSDisk.Caching}}Read More

606 Views
To get the Azure disk encryption settings using PowerShell, we first need to retrieve the VM information using the Get-AzVM command. Before running this command, make sure that you are connected to the Azure account (Connect-AzAccount) and the proper subscription (Set-AzContext).In this example, we have a TestVM.$vm = Get-AzVM -Name TestVMWe will use the StorageProfile property and OSdisk sub-property to get the encryption settings.$vm.StorageProfile.OsDisk.EncryptionSettingsThe above command will retrieve the encryption settings for the Azure VM disk encryption.To retrieve all the azure VMs disk encryption for the specific subscription use, Get-AzVM | Select Name, ResourceGroupName, @{N='Disk_Encryption';E={$_.StorageProfile.OSDisk.EncryptionSettings}}Read More

27K+ Views
To uninstall the MSI package using PowerShell, we need the product code and then the product code can be used with msiexec file to uninstall the particular application.Product code can be retrieved using the Get-Package or Get-WmiClass method. In this example, we will uninstall the 7-zip package.$product = Get-WmiObject win32_product | ` where{$_.name -eq "7-Zip 19.00 (x64 edition)"}$product.IdentifyingNumberThe above command will retrieve the product code. To uninstall the product using msiexec, use /x switch with the product id. The below command will uninstall the 7-zip using the above-retrieved code.msiexec /x $product.IdentifyingNumber /quiet /norebootThis is the cmd command but we can run ... Read More

14K+ Views
You can retrieve the MSI installed packaged product code on the windows OS using PowerShell with Get-Package or Get-WmiObject command.In this example, we will retrieve the product code of 7-zip.Get-Package -Name '7-Zip 19.00 (x64 edition)' | fl *You can use the tagid or mentioned properties to filter the product code.To retrieve the package from the remote computer using the Get-Package method, use InvokeCommand.Invoke-Command -ComputerName TestMachine -ScriptBlock{ (Get-Package -Name '7-Zip 19.00 (x64 edition)').TagID }Another way to retrieve the product code is by using the WMI method as shown below.PS C:\> $product = Get-WmiObject win32_product | where{$_.name - eq "7-Zip 19.00 (x64 ... Read More

3K+ Views
To install the MSI file to the custom directory using PowerShell, we can use the TARGETDIR, INSTALLDIR, INSTALLPATH, etc arguments for the custom path, depending upon the MSI file that it supports.msiexec /i "C:\temp\7z1900-x64.msi" INSTALLDIR="D:\ProgramFiles\7zip" /quietThe above command can be run into PowerShell and cmd both but you can’t control the process that to wait until the installation finishes. To control the above command, we can use the Start-Process cmdlet in PowerShell.Start-Process -FilePath "C:\windows\system32\msiexec.exe" -ArgumentList "/i C:\temp\7z1900-x64.msi INSTALLDIR='D:\ProgramFiles\7zip' /quiet" -WaitIf the INSTALLDIR is not supported by the MSI file then you can use the other parameters as specified above or ... Read More

16K+ Views
To login to the Azure account using Azure CLI, we need to use the az login command. Once you type the az login command, it will prompt for the Azure portal login console.If you need to log in with the device authentication code in the browser, you need to use the parameter –use-device-code.PS C:\> az login --use-device-code To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ‘DeviceCode’ to authenticate.You need to open a website https://microsoft.com/devicelogin/ and have to enter a code. If you are not already connected with the Microsoft Azure portal, you ... Read More

484 Views
To get the Azure VM NIC name using Azure CLI, use the below command but before running the command make sure that you are connected to the Azure Account and the proper Azure subscription using Azure CLI.az vm show -n AzureVM -g ResourceGroup --query '[networkProfile.networkInterfaces][].id' -otsvWe need the NIC name from this. If you are running the Azure CLI in the PowerShell terminal then use the command below.PS C:\> $nicinfo = az vm show -n VMname -g RGName --query '[networkProfile.networkInterfaces][].id' -otsv PS C:\> ($nicinfo.Split('/'))[-1]

795 Views
To get the Azure VM username using Az CLI, we need to use the below command.PS C:\> az vm show -n AzVM -g ResourceGroup --query '[osProfile.adminUsername]' -otsvThe above command will retrieve the Azure VM username. You can also use the below command to retrieve the Azure VM username without knowing the resource group name.PS C:\> az vm list --query "[?name=='vmname'].osProfile.adminUsername" -otsvBefore running the above commands, make sure that you are connected to the Azure cloud and the specific Azure Subscription.

724 Views
To find the location of the particular Azure VM using Az CLI, we can use the below command but before that, you need to make sure you are connected to the Azure cloud and had set that specific subscription.PS C:\> az vm show -n VMName -g ResourceGroupName --query '[location]' -otsvAlternatively, you can use the below command to get the location of the Azure VM.PS C:\> az vm list --query "[?name==’VMName’].location" -otsv