Found 463 Articles for PowerShell

How to enable credssp authentication on windows server using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 11:05:39

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             : http://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 }

How to get the windows authentication settings using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 11:07:33

710 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

How to get Azure VM activity logs using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 11:09:31

1K+ 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 Azure VM storage account type using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 10:06:59

519 Views

To get the Azure VM storage account type using PowerShell, we need to get the Azure VM storage profile setting from the Get-AzVM command.PS C:\> $vm = Get-AzVM -Name TestVM PS C:\> $vm.StorageProfile.OsDisk.ManagedDisk.StorageAccountTypeOutputTo get the storage account type on the multiple VMs from the specific subscription, use the below command.Get-AzVM | Select Name,ResourceGroupName, @{N='StorageType';E={$_.StorageProfile.OsDisk.ManagedDisk.StorageAccountType}}

How to get the installed Azure VM extension using PowerShell?

Chirag Nagrekar
Updated on 01-Sep-2021 09:19:01

825 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

How to get the Azure VM disk caching settings using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 10:05:55

403 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

How to get the Azure VM disk encryption settings using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 10:05:29

363 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

How to uninstall the MSI package using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 10:04:41

19K+ 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

How to retrieve the MSI package product code using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 11:28:17

11K+ 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

How to install MSI file to the custom directory using PowerShell?

Chirag Nagrekar
Updated on 31-Aug-2021 10:02:51

2K+ 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

Previous 1 ... 4 5 6 7 8 ... 47 Next
Advertisements