This cmdlet is part of the Vexasoft Cmdlet Library. You can download it now or click here to find out more.

Set-LogonNotice

Synopsis

Sets a logon message on a local or remote computer.

Syntax

  • Set-LogonNotice [-Title] [-Message] [-ComputerName] [-Credential]

Description

The Set-LogonNotice cmdlet is used to set a logon message, displayed before the user is presented with the logon box, on a local or remote computer.

Parameters

  • Title The title of the window displaying the logon message. Cannot be used when the Clear parameter has been specified.
  • Message The message to be displayed at logon. Cannot be used when the Clear parameter has been specified.
  • ComputerName The computer against which to run the cmdlet. By default this parameter will be populated with the name of the local computer.
  • Credential The credentials under which to run the cmdlet. By default this cmdlet will run as the current user. Using this parameter and the Get-PSCredential cmdlet you can specify an alternate set of credentials under which to execute this command.

Inputs

Set-LogonNotice accepts the output of the Get-LogonNotice cmdlet as an input object. In addition, the Title, Message and ComputerName parameters each accept pipeline input by property name.

Outputs

Set-LogonNotice makes changes directly to the Windows registry and does not output any Powershell objects.

Notes

The Set-LogonNotice cmdlet requires that the RPC service is started on the computer it is trying to access and that DNS services are available to resolve target host names.

Example 1

This command will set a logon notice on the local computer with the given Title and Message:

Set-LogonNotice -Title "Important Notice" -Message "Only authorized users are permitted to logon to this server."

Example 2

This command will get the logon notice from computer PC01 and recreate it on computer PC02:

Get-LogonNotice -Computer PC01 | Set-LogonNotice -Computer PC02