ISendMessage Method: SendMessageToDomain

SendMessageToDomain
(
DomainName  As  String,
 Message   As  String,
 [SourceComputerName As  String]
);

Parameters

[in] String DomainName
Name of the domain to which you want to send the message.

[in] String Message
Message string to be sent to the domain.

[in] String SourceComputerName
Name of the computer where the send call is to be executed. This parameter is optional. If this parameter is not specified, the call is executed on the current computer.

Description
Sends the given message to all users and computers in the specified domain. If - instead of the domain name - you specify a computer name, the message is sent to all local users of that computer besides the computer itself.

Example

Dim SendMsg As ISendMessage
'Get the ISendMessage interface.
Set SendMsg = CreateObject ("DirectScript.SendMessage.1")
'Send message to all the users and computers in domain MSFT.
SendMsg.SendMessageToDomain "MSFT", "This is test message", "\\MOON"

 See Also