Skip to main content

Posts

Showing posts from 2025
Script to get the list of VM and there configuration which are hosted in Hyper -V host. Please find the script below. # Ensure the Hyper-V module is loaded Import-Module Hyper-V # Create the export directory if it doesn't exist $ExportPath = "C:\Temp\HyperV_VM_List.csv" if (!(Test-Path "C:\Temp")) {     New-Item -Path "C:\Temp" -ItemType Directory -Force } # Get the Hyper-V Host Details $HostName = $env:COMPUTERNAME $HostIPConfig = Get-NetIPConfiguration | Where-Object { $_.IPv4Address -ne $null } | Select-Object -First 1 $HostIP = $HostIPConfig.IPv4Address.IPAddress $Subnet = $HostIPConfig.IPv4Address.PrefixLength $Gateway = if ($HostIPConfig.IPv4DefaultGateway) { $HostIPConfig.IPv4DefaultGateway.NextHop } else { "N/A" } $DNS = if ($HostIPConfig.DNSServer) { ($HostIPConfig.DNSServer.ServerAddresses -join ", ") } else { "N/A" } # Get the list of all VMs on the local Hyper-V host $VMs = Get-VM # Initialize an array to store...
  PowerShell DSC log amount issue on operating system drive Overview Problem Impact Microsoft Ticket (Workaround) solution References Overview When using PowerShell DSC on a configured system in some (seldom) cases it can lead to log amount issues in a specific folder. The following folder grows (over time) so several GB size holding hundreds and thousands of JSON log files as visible in the following screenshot: Also sometimes it looks like this: Problem The problem is (but must not be) related to DSC configuration issues as far as it could be analyzed. The log folder „Configuration Status“ is filled with sometimes up to 7 Megabyte sized JSON files. This log folder (based on our analysis) is used for sending reports to report server but is not cleaned up automatically. Impact Some PowerShell DSC managed systems need extensive disk space due to log directory grown to 40 Gigabyte plus. This causes an alert in disk space / availability monitoring and could in some cases lead to non w...
How to remove "SLEEP" and "SHUTDOWN" options from power button on CTRL+ATL+Delete Screen but keep "RESTART" option. Hello, Unfortunately there is no granular setting for the Power button on the CTRL-ALT-DEL screen. Either is enabled or disabled using: 1.Press Win + R to open the Run command dialog box. 2.Type gpedit.msc and press Enter to open the Local Group Policy Editor. 3.Navigate to User Configuration > Administrative Templates > Start Menu and Taskbar. 4.Double-click on the Remove and prevent access to the Shut Down, Restart, Sleep, and Hibernate commands option. Other option is to keep the button disable its functionality by changing the next registry chain: [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer] "NoClose"=dword:00000001