sabato 15 ottobre 2022

Internet explorer in Windows 10 / 11

 





Cambiare porta RDP

 UI

  1. Regedit
  2. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
  3. Modificare PortNumber
  4. Riavviare pc

PowerShell (come admin)

cambio porta regedit
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\
Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value xxxx 

apertura porta firewall windows
New-NetFirewallRule -DisplayName 'RDP PORT TCP-In' -Profile 'Any'
-Direction Inbound -Action Allow -Protocol TCP -LocalPort xxxx 

New-NetFirewallRule -DisplayName 'RDP PORT UDP-In' -Profile 'Any'
-Direction Inbound -Action Allow -Protocol UDP -LocalPort xxxx

Restart-Service TermService -Force

Verifica porta
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber"

Aprire la nuova porta sul firewall aziendale e connettersi usando ip:porta

giovedì 13 ottobre 2022

Ridurre un disco VHDX con PowerShell

 Se il disco è in formato VHD deve essere prima convertito in VHDX tramite il seguente comando

    - Convert-VHD path\drive.vhd path\drive.vhdx


1 - Montare il VHDX

    -    mount-vhd path\drive.vhdx -passthru | get-disk | get-partition | get-volume

2 - Ridurre la partizione

    -    resize-partition –driveletter E -size 250GB

3 - Scollegare il disco

    -    dismount-vhd path\drive.vhdx

4 - Ridimensionare il disco

    -    resize-vhd path\drive.vhdx -ToMinimumSize