WinSession

Send-ActiveUserMessage

Overview

Displays a message to the active user on the device.

Description

BY DEFAULT, this function will:

  • Send a message to the user on the screen with the specified Title and Message
  • The dialog box will only contain the 'OK' response
  • The dialog box will time out in 60-seconds

Cmdlet Attributes

Copy
Copied
CmdletBinding : []

Parameters

Title : System.String

The title message to be displayed in the message box.

Attributes

Copy
Copied
Parameter : [Mandatory, Position = 0]

Message : System.String

The message to be displayed in the message box.

Attributes

Copy
Copied
Parameter : [Mandatory, Position = 1]

DialogType : System.String

The set of options which should be displayed in the message box ( ex: OK, OK and Cancel, etc. ).

Default: 'OK'

Attributes

Copy
Copied
Parameter   : [Position = 2]
ValidateSet : ['AbortRetryIgnore', 'CancelTryContinue', 'OK', 'OKCancel', 'RetryCancel', 'YesNo', 'YesNoCancel']

Timeout : System.Int32

The amount of time to wait before returning a [ MESSAGE_RESPONSE ] value indicating a timeout was reached.

Default: 60

Attributes

Copy
Copied
Parameter : [Position = 3]

Output

Type: [ MESSAGE_RESPONSE ]

The response chosen by the logged-in user ( this includes a timeout ).

Example

Copy
Copied
PS> Send-ActiveUserMessage -Title 'Luke' -Message 'I AM your father!' -DialogType 'AbortRetryIgnore' -Timeout 60 
IGNORE 

History

Author Date Version Release Notes
Anthony Maxwell 09/20/2023 1.0.0 - Inital release.

Start-ProcessAsActiveUser

Overview

Starts a Windows process in the context of the logged in, active user.

Cmdlet Attributes

Copy
Copied
CmdletBinding : []

Parameters

Path : System.String

The path to the application to launch.

Attributes

Copy
Copied
Parameter : [Mandatory = $true, Position = 0, ValueFromPipeline = $true]

ArgumentList : System.String[]

Any command-line arguments which should be passed to the launched application.

Default: @()

Attributes

Copy
Copied
Parameter : [Position = 1]

WorkingDirectory : System.String

The path to be used as the working directory by the launched application.

Default: "${env:SystemDrive}\"

Attributes

Copy
Copied
Parameter : [Position = 2]

Output

Type: [ System.Boolean ]

Indicates if the process successfully launched.

Example

Copy
Copied
PS> Start-ProcessAsActiveUser -Path "${env:SystemDrive}\Program Files\8x8 Inc\8x8 Work\8x8 Work.exe" 
True 

History

Author Date Version Release Notes
Anthony Maxwell 09/21/2023 1.0.0 - Initial release.

Test-UserActive

Overview

Determines if a user is actively working on the device through RDP or at the physical console.

Example

Copy
Copied
PS> Test-UserActive 
True 

History

Author Date Version Release Notes
Anthony Maxwell 09/20/2023 1.0.0 - Inital release.