21 lines
1.1 KiB
PowerShell
21 lines
1.1 KiB
PowerShell
########## Report the current properties and enable if needed ##########
|
|
|
|
#Read the configuration settings for Remote Screen Blanking which are in the class IPS_ScreenConfigurationService
|
|
$screenPropRef = $wsmanConnectionObject.NewReference("SELECT * FROM IPS_ScreenConfigurationService")
|
|
$screenPropInstance = $screenPropRef.Get()
|
|
#Check if Remote Screen Blanking is enabled; If it is not, then set it to enabled
|
|
$enabledState = $screenPropInstance.GetProperty("EnabledState")
|
|
Write-Host "Enabled state: " $enabledState
|
|
If ($enabledState -eq "0")
|
|
{
|
|
Write-Host "Remote Screen Blanking was not enabled, so enabling it now"
|
|
$screenPropInstance.SetProperty("EnabledState", "1")
|
|
$screenPropRef.Put($screenPropInstance)
|
|
}
|
|
#Check if the screen is currently being blanked
|
|
$screenState = $screenPropInstance.GetProperty("CurrentState")
|
|
Write-Host "Screen state is (0=Not Blanked, 1=Blanked): " $screenState
|
|
#Check how many reboots can occur while maintaining an actively blanked screen
|
|
$rebootsRemaining = $screenPropInstance.GetProperty("RemainingConsecutiveRebootsNum")
|
|
Write-Host "Remaining reboots: " $rebootsRemaining
|