Showing posts with label Windows Server 2016. Show all posts
Showing posts with label Windows Server 2016. Show all posts

Sunday, February 25, 2024

[WSRV] Import private key into certificate file

 

openssl pkcs12 -export -out cert.pfx -inkey private.key -in cert.crt -certfile CACert.crt

Wednesday, February 7, 2024

[WSRV] Check Hyper-V VMs Paths


List Checkpoint, Configuration and Snapshot File Locations:

 

get-vm  | select id,name,*location | ft -AutoSize


List the HardDrives attached into the Virtual Machines


get-vm | Get-VMHardDiskDrive | sort Path | select vmname,Path

Wednesday, October 16, 2019

[WSRV] Check Hyper-V Host



(get-item "HKLM:\SOFTWARE\Microsoft\VirtualMachine\Guest\Parameters").GetValue("HostName")

Monday, January 14, 2019

[WSRV] Search for file with a special character in the file name?



~="("

~="&"

~="hello you (1"

[WSRV] AVMA Keys


slmgr /ipk <AVMA_key>  



AVMA keys

The following AVMA keys can be used for Windows Server 2019.
EditionAVMA key
DatacenterH3RNG-8C32Q-Q8FRX-6TDXV-WMBMW
StandardTNK62-RXVTB-4P47B-2D623-4GF74
Essentials2CTP7-NHT64-BP62M-FV6GG-HFV28
The following AVMA keys can be used for Windows Server, version 1809.
EditionAVMA key
DatacenterH3RNG-8C32Q-Q8FRX-6TDXV-WMBMW
StandardTNK62-RXVTB-4P47B-2D623-4GF74
The following AVMA keys can be used for Windows Server, version 1803 and 1709.
EditionAVMA key
DatacenterTMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
StandardC3RCX-M6NRP-6CXC9-TW2F2-4RHYD
The following AVMA keys can be used for Windows Server 2016.
EditionAVMA key
DatacenterTMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
StandardC3RCX-M6NRP-6CXC9-TW2F2-4RHYD
EssentialsB4YNW-62DX9-W8V6M-82649-MHBKQ
The following AVMA keys can be used for Windows Server 2012 R2.
EditionAVMA key
DatacenterY4TGP-NPTV9-HTC2H-7MGQ3-DV4TW
StandardDBGBW-NPF86-BJVTX-K3WKJ-MTB6V
EssentialsK2XGM-NMBT3-2R6Q8-WF2FK-P36R2

Thursday, January 3, 2019

[WSRV] Powershell Cmdlets - Network



Test-NetConnection -ComputerName "Hostname or IP"

Test-NetConnection "Hostname" -Port #

Test-NetConnection "Hostname" -traceroute

Get-NetIPConfiguration

Resolve-DnsName -Name "Hostname"

Get-NetTCPConnection

Get-DnsClient
Set-DnsClientServer Address

Clear-DnsClientCache


Disable-NetAdapter -Name "Adapter Name"
Enable-NetAdapter -Name "Adapter Name"

Saturday, July 21, 2018

[WSRV] Exporting VM settings



$FormatEnumerationLimit = -1

cd $HOME\Desktop
mkdir VM

Get-VM | ft -autosize > $home\Desktop\VM\Get_VM_ft.txt
Get-VM | fl > $home\Desktop\VM\Get_VM_fl.txt
Get-VM | Get-VMCheckpoint | ft -autosize > $home\Desktop\VM\Get_VMCheckpoint_ft.txt
Get-VM | Get-VMsnapshot | ft -autosize > $home\Desktop\VM\Get_VMsnapshot_ft.txt
Get-VM | Get-VMHardDiskDrive | fl > $home\Desktop\VM\Get_VMHardDiskDrive_fl.txt
Get-VM | Get-VMHardDiskDrive | ft -autosize > $home\Desktop\VM\Get_VMHardDiskDrive_ft.txt
Get-VMHost > $home\Desktop\VM\Get_VMHost.txt
Get-VM | Get-VMIdeController | ft -AutoSize > $home\Desktop\VM\Get_VMIdeController_ft.txt
Get-VM | Get-VMIntegrationService | ft -AutoSize > $home\Desktop\VM\Get_VMIntegrationService_ft.txt
Get-VM | Get-VMIntegrationService | sort enabled | ft -AutoSize > $home\Desktop\VM\Get_VMIntegrationService_sort.txt
Get-VM |  Get-VMMemory | ft -AutoSize > $home\Desktop\VM\Get_VMMemory_ft.txt
Get-VM | Get-VMNetworkAdapter | ft -AutoSize > $home\Desktop\VM\Get_VMNetworkAdapter_ft.txt
Get-VM | Get-VMNetworkAdapter | fl > $home\Desktop\VM\Get_VMNetworkAdapter_fl.txt
Get-VMNetworkAdapterIsolation > $home\Desktop\VM\Get_VMNetworkAdapterIsolation.txt
Get-VMNetworkAdapterVlan > $home\Desktop\VM\Get_VMNetworkAdapterVlan.txt
Get-VMSystemSwitchExtension > $home\Desktop\VM\Get_VMSystemSwitchExtension.txt
Get-VMSwitch > $home\Desktop\VM\Get_VMSwitch.txt
Get-VMSwitch | fl > $home\Desktop\VM\Get_VMSwitch_fl.txt

Sunday, August 27, 2017

[WSRV] Script to Block .Net 4.7


$registryPath = "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\WU"
New-Item -Path $registryPath -Force | Out-Null
$Name = "BlockNetFramework47"
$value = "1"
New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null

Saturday, August 5, 2017

Sunday, July 23, 2017

[EX2013] Deploy MaxConcurrentApi



# deploy MaxConcurrentApi key in multiple Exchange servers
Get-Exchangeserver | foreach{Invoke-Command -ComputerName $_.fqdn -ScriptBlock {
    $registryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters"
    $Name = "MaxConcurrentApi"
    $value = "10"

    IF(!(Test-Path $registryPath)){
        New-Item -Path $registryPath -Force | Out-Null
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}
    ELSE {
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}

    restart-service netlogon -Force
}}

# deploy MaxConcurrentApi key in multiple DC servers. This is captured from the “currentDomainControllers” result.
(Get-Exchangeserver servername -Status).CurrentDomainControllers | foreach{Invoke-Command -ComputerName $_ -ScriptBlock {
    $registryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters"
    $Name = "MaxConcurrentApi"
    $value = "10"

    IF(!(Test-Path $registryPath)){
        New-Item -Path $registryPath -Force | Out-Null
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}
    ELSE {
        New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force | Out-Null}

    restart-service netlogon -Force
}}

Saturday, June 17, 2017

[WSRV] Temporarily block installation of the .NET




  • Back up the registry.
  • Start Registry Editor. To do this, click Start, type regedit in the Start Search box, and then press Enter.
  • Locate and click the following subkey:

    HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP
  • After you select this subkey, point to New on the Edit menu, and then click Key.
  • Type WU, and then press Enter.
  • Right-click WU, point to New, and then click DWORD Value.
  • Type BlockNetFramework47, and then press Enter.
  • Right-click BlockNetFramework47, and then click Modify.
  • In the Value data box, type 1, and then click OK.
  • On the File menu, click Exit to exit Registry Editor.