Win32_Desktop

Win32 Desktop
root/cimv2dynamickey : Name

The Win32_DesktopWMI class represents the common characteristics of a user's desktop. The properties of this class can be modified by the user to customize the desktop.

On this page

Main example

List instances

# All instances of Win32_Desktop, with the main properties
Get-CimInstance -ClassName Win32_Desktop |
    Select-Object -Property Name, Description, BorderWidth, Caption

Examples

Filter with WQL

# WQL filter evaluated by the provider: only the instances where CoolSwitch is TRUE
Get-CimInstance -ClassName Win32_Desktop -Filter 'CoolSwitch = TRUE' |
    Select-Object -Property Name, Description, BorderWidth, Caption

The filter is evaluated by the WMI provider: less data is transferred than with Where-Object.

Query a remote computer (CIM session)

review before running
# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
    Get-CimInstance -CimSession $cimSession -ClassName Win32_Desktop |
        Select-Object -Property Name, Description, BorderWidth, Caption
} finally {
    Remove-CimSession -CimSession $cimSession
}

WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.

Show the class structure

# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName Win32_Desktop
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

21 of 21 properties
NameTypeAccessDescription
BorderWidthuint32read

Width of the borders around all windows with adjustable borders.

Example: 3

Code
# Value of BorderWidth for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, BorderWidth |
    Select-Object -Property Name, BorderWidth
Captionstringread

Short textual description of the current object.

Code
# Value of Caption for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, Caption |
    Select-Object -Property Name, Caption
CoolSwitchbooleanread

Fast task switching is turned on. Fast task switching allows the user to switch between windows using the ALT+TAB keyboard combination.

Code
# Value of CoolSwitch for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, CoolSwitch |
    Select-Object -Property Name, CoolSwitch
CursorBlinkRateuint32read

Length of time between successive cursor blinks.

Example: 530

Unit: milliseconds

Code
# Value of CursorBlinkRate for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, CursorBlinkRate |
    Select-Object -Property Name, CursorBlinkRate
Descriptionstringread

Textual description of the current object.

Code
# Value of Description for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, Description |
    Select-Object -Property Name, Description
DragFullWindowsbooleanread

Contents of a window are shown when a user moves the window.

Code
# Value of DragFullWindows for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, DragFullWindows |
    Select-Object -Property Name, DragFullWindows
GridGranularityuint32read

Spacing of the grid that windows are bound to on the desktop. This makes organizing windows easier. The spacing is usually fine enough that the user does not notice it.

Example: 1

Unit: 8 pixels

Code
# Value of GridGranularity for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, GridGranularity |
    Select-Object -Property Name, GridGranularity
IconSpacinguint32read

Spacing between icons.

Example: 75

Unit: pixels

Code
# Value of IconSpacing for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, IconSpacing |
    Select-Object -Property Name, IconSpacing
IconTitleFaceNamestringread

Font used for the names of the icons.

Example: "MS San Serif"

Code
# Value of IconTitleFaceName for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, IconTitleFaceName |
    Select-Object -Property Name, IconTitleFaceName
IconTitleSizeuint32read

Icon font size.

Example: 9

Unit: point

Code
# Value of IconTitleSize for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, IconTitleSize |
    Select-Object -Property Name, IconTitleSize
IconTitleWrapbooleanread

Icon's title text wraps to the next line.

Code
# Value of IconTitleWrap for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, IconTitleWrap |
    Select-Object -Property Name, IconTitleWrap
Name keystringread

Name that identifies the current desktop profile.

Example: "MainProf"

Code
# Value of Name for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name |
    Select-Object -Property Name
Patternstringread

Name of the pattern used as the background for the desktop.

Code
# Value of Pattern for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, Pattern |
    Select-Object -Property Name, Pattern
ScreenSaverActivebooleanread

Screen saver is active.

Code
# Value of ScreenSaverActive for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, ScreenSaverActive |
    Select-Object -Property Name, ScreenSaverActive
ScreenSaverExecutablestringread

Name of the current screen saver executable file.

Example: "LOGON.SCR"

Code
# Value of ScreenSaverExecutable for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, ScreenSaverExecutable |
    Select-Object -Property Name, ScreenSaverExecutable
ScreenSaverSecurebooleanread

Password is enabled for the screen saver.

Code
# Value of ScreenSaverSecure for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, ScreenSaverSecure |
    Select-Object -Property Name, ScreenSaverSecure
ScreenSaverTimeoutuint32read

Amount of time that passes before the screen saver starts.

Unit: seconds

Code
# Value of ScreenSaverTimeout for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, ScreenSaverTimeout |
    Select-Object -Property Name, ScreenSaverTimeout
SettingIDstringread

Identifier by which the current object is known.

Code
# Value of SettingID for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, SettingID |
    Select-Object -Property Name, SettingID
Wallpaperstringread

File name for the wallpaper design on the background of the desktop.

Example: "WINNT.BMP"

Code
# Value of Wallpaper for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, Wallpaper |
    Select-Object -Property Name, Wallpaper
WallpaperStretchedbooleanread

Wallpaper is stretched to fill the entire screen. Microsoft Plus! must be installed before this option is available. If FALSE, the wallpaper retains its original dimensions on the desktop background.

Code
# Value of WallpaperStretched for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, WallpaperStretched |
    Select-Object -Property Name, WallpaperStretched
WallpaperTiledbooleanread

Wallpaper is tiled or centered.

Code
# Value of WallpaperTiled for each instance
Get-CimInstance -ClassName Win32_Desktop -Property Name, WallpaperTiled |
    Select-Object -Property Name, WallpaperTiled

Remarks

The Win32_Desktop class is derived from CIM_Setting.

The calling process that uses this class must have the SE_RESTORE_NAME privilege on the computer in which the registry resides. For example, if you enumerate this class on the local computer, the account under which your application runs must have this privilege. For more information, see Executing Privileged Operations.

Inheritance

Superclass chain

  1. CIM_Setting
  2. Win32_Desktop

Known subclasses

No known subclass.

Requirements

Namespace
root/cimv2
Minimum client
Windows Vista
Minimum server
Windows Server 2008
Provider
CIMWin32
MOF file
CIMWin32.mof
DLL
CIMWin32.dll
Class qualifiers

Dynamic Provider("CIMWin32") Privileges("SeRestorePrivilege") UUID("{8502C4E3-5FBB-11D2-AAC1-006008C78BC7}") AMENDMENT

Microsoft source

Source: Microsoft Learn

Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.