Send-UDP Cmdlet
Parameters Output Objects Configuration Settings
The Send-UDP cmdlet is used to send UDP datagrams.
Syntax
Send-UDP [parameters]
Remarks
The Send-UDP cmdlet will bind to a specific local host address and send UDP datagrams to a remote Server.
The cmdlet can be used by specifying a Server and Port to send datagrams to, and optionally you can set LocalIP to the IP address of the interface that you want to use, as well as LocalPort for the port. The Data parameter will specify the data that should be sent to the remote host. For each datagram sent, the cmdlet will return a UDPData object. Due to the nature of the UDP protocol, the cmdlet cannot know whether the remote host actually received the data or not. The Receive-UDP cmdlet can be used for the server side equivalent of this client oriented cmdlet.
This cmdlet also exposes the Wake-on-LAN functionality through the WakeOnLAN parameter. Supplying the MAC address of the remote network interface through the WakeOnLAN parameter and the IP address of the interface through the Server parameter, will cause for the cmdlet to send a WakeOnLAN request to the remote NIC. If the NIC supports wake on LAN, then the remote machine will be turned on.
The cmdlets support pipeline input for some of their parameters. Prebuilding an object and piping it to the cmdlet is very useful, but should be used with caution to prevent security conflicts. Steps have been taken to decrease the risk of a possibly accidental pipe to the cmdlet, for instance, the Credential parameter cannot be piped to the cmdlet and must be specified manually.
# send test udp packet to server
send-udp -server $server -port 4444 -data
"test from netcmdlets"
# WOL (wake on LAN)
send-udp -server 10.0.1.173 -WakeOnLAN 00-80-C8-E9-A5-A9
Parameter List
The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.
LogFile | The location of a file to which debug information is written. |
Config | Specifies one or more configuration settings. |
Data | A string of data to be sent to the remote host. |
LocalIP | The IP address of the local interface to use. |
LocalPort | The local port that the cmdlet should use. |
LogFile | The location of a file to which debug information is written. |
Port | The UDP port in the remote host to which to send data. |
Route | If set to False, forces the socket to send data directly to interface (no routing). |
Server | The address of the Server. |
WakeOnLAN | Specifies the MAC address of the host. |
Output Objects
The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.
UDPData | This object is created after a UDP packet is received. |
Configuration Settings
The following is a list of configuration settings for the cmdlet with short descriptions. Click on the links for further details.
CaptureIPPacketInfo | Used to capture the packet information. |
DestinationAddress | Used to get the destination address from the packet information. |
DontFragment | Used to set the Don't Fragment flag of outgoing packets. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the cmdlet binds. |
MaxPacketSize | The maximum length of the packets that can be received. |
ShareLocalPort | If set to True, allows more than one instance of the cmdlet to be active on the same local port. |
UseConnection | Determines whether to use a connected socket. |
QOSDSCPValue | Used to specify an arbitrary QOS/DSCP setting (optional). |
QOSTrafficType | Used to specify QOS/DSCP settings (optional). |
UseIPv6 | Whether or not to use IPv6. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
UseBackgroundThread | Whether threads created by the cmdlet are background threads. |
UseInternalSecurityAPI | Tells the cmdlet whether or not to use the system security libraries or an internal implementation. |