Microsoft Technologies Articles

Page 138 of 175

How to get the Accelerated networking status of Azure VM using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 751 Views

From the Azure Portal, we can find the Accelerated Networking (AN) status from the networking blade.To get the AN settings on the VM, we need to first retrieve the NIC information because it is set on it. We have the VM named ‘TestVM’ and we will retrieve its NIC information.PS C:\> $vm = Get-AzVM -Name TestVMTo get the NIC associated with the VM, $nicname = (($vm.NetworkProfile.NetworkInterfaces.id).Split('/'))[-1]We need to retrieve the NIC settings to get the AN setting.$nicsetting = Get-AzNetworkInterface -ResourceGroupName $vm.ResourceGroupName - Name $nicnameTo get the AN settings, use the EnableAcceleratedNetworking property.$nicsetting.EnableAcceleratedNetworkingIf you want to retrieve the AN settings on ...

Read More

How to get the Azure VM username using Azure CLI in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 849 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.

Read More

How to get the Azure VM Size using Azure CLI in PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 2K+ Views

To get the Azure VM size using Azure CLI, we first need to make sure that the Azure account is connected to the specific subscription for the VM that we need to retrieve the VM size.To get the specific Azure VM size, we need to first retrieve the VM details and then need to run the JMESPATH query to retrieve the VM size.az vm show -n VMname -g ResourceGroupName --query '[hardwareProfile.vmSize]' -otsvyou can also retrieve the size of the VM without resource group name, using “az vm list” command.az vm list --query "[?name=='AzVM'].hardwareProfile.vmSize" -otsv

Read More

How to get Azure VM activity logs using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 2K+ Views

To get the Azure VM activity logs with PowerShell, we need to use the Get-AzLog command. Before running, AZ commands make sure that you are connected to the Azure Account using (ConnectAzAccount) and the subscription (Set-AzContext).We have the below TestVM, we need to retrieve activity logs and we need its resource id. We will get the resource ID using, PS C:\> $vm = Get-AzVM -VMName TestVMPS C:\> $vm.IdWe need to use this ID in the Get-AzLog command to retrieve the activity logs.PS C:\> Get-AzLog -ResourceId $vm.IdIt will provide all the azure events for that specific resource group and you can ...

Read More

How to get the windows authentication settings using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 1K+ Views

To get the windows server authentication setting using PowerShell, we can use the below command on the local server.PS C:\> Get-ChildItem WSMan:\localhost\Service\Auth | Select name, valueOutputName              Value ----              ----- Basic             false Kerberos          true Negotiate         true Certificate       false CredSSP           false CbtHardeningLevel RelaxedTo get the same settings on the remote servers, use the below command.Invoke-Command -ComputerName TestMahchine1, TestMachine2 - ScriptBlock {    Get-ChildItem WSMan:\localhost\Service\Auth } | Select PSComputerName, Name, Auth

Read More

How to enable credssp authentication on windows server using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 2K+ Views

Before enabling the credssp authentication for the windows server, we will first check the credssp status using the below command.Get-ChildItem WSMan:\localhost\Service\Auth | Where-Object {$_.Name -eq "CredSSP"}    | Select Name, ValueOutputName    Value ----    ----- CredSSP falseTo enable the credssp,PS C:\> Enable-WSManCredSSP -role server -ForceOutputcfg             : schemas.microsoft.com/wbem/wsman/1/config/service/auth lang             : en-US Basic             : false Kerberos          : true Negotiate         : true Certificate       : false CredSSP           : true CbtHardeningLevel : RelaxedTo enable the credssp authentication on the remote computers,Invoke-Command -ComputerName TestMahchine1, TestMachine2 - ScriptBlock {    Enable-WSManCredSSP -Role Server -Force }

Read More

How to disable the credssp authentication using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 1K+ Views

To disable the credssp on the local computer using PowerShell, use the below command.PS C:\> Disable-WSManCredSSP -Role Server -VerboseYou can check if the credssp is disabled, using the below command.PS C:\> Get-ChildItem WSMan:\localhost\Service\Auth | Where-Object {$_.Name    -eq"CredSSP"} | Select Name, Value Name    Value ----    ----- CredSSP falseTo disable the credssp authentication on the remote computers using PowerShell,Invoke-Command -ComputerName TestMahchine1, TestMachine2 - ScriptBlock {    Disable-WSManCredSSP -Role Server }

Read More

How to disable basic authentication for windows server using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 529 Views

Basic authentication is the insecure authentication for the windows. To disable the basic authentication on the windows server using PowerShell,PS C:\> Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" -Value $false -VerboseTo disable the basic authentication on the remote windows servers using PowerShell, use the below command,Invoke-Command -ComputerName TestMahchine1, TestMachine2 - ScriptBlock {    Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" -Value    $false -Verbose }

Read More

How to enable the basic authentication for windows servers using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 1K+ Views

Basic authentication is the insecure authentication for windows. Before enabling it make sure you comply with your organization policies. To enable the basic authentication for the windows servers using PowerShell, we can use the below command.PS C:\> Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" -Value $true -VerboseTo enable the basic authentication for the remote windows servers using PowerShell, use the below command.Invoke-Command -ComputerName TestMahchine1, TestMachine2 - ScriptBlock {    Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" -Value    $true -Verbose }

Read More

How to enable the Azure VM accelerated settings using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 31-Aug-2021 288 Views

To enable the Azure VM accelerated settings using PowerShell, we need to enable the EnableAcceleratedNetworking property on the NIC attached to the VM.$vm = Get-AzVM -Name TestVM $nicname = (($vm.NetworkProfile.NetworkInterfaces.id).Split('/'))[-1] $nicsetting = Get-AzNetworkInterface -ResourceGroupName $vm.ResourceGroupName - Name $nicname $nicsetting.EnableAcceleratedNetworking = $trueIn the above example, we are setting AN settings on the Azure VM “TestVM”. To set the AN setting on the particular subscription, use the below command. Make sure that you are connected to the proper subscription using the Set-AzContext command.Get-AzVM | Select Name, ResourceGroupName, `    @{N='Accelerated Netoworking'; E={       $nic = (($_.NetworkProfile.NetworkInterfaces.id).Split('/'))[-1]       $nicsetting ...

Read More
Showing 1371–1380 of 1,744 articles
« Prev 1 136 137 138 139 140 175 Next »
Advertisements