< Back
Get-NetworkAddress
Post
NAME Get-NetworkAddress
SYNOPSIS
Get the network address for a network range.
SYNTAX
Get-NetworkAddress [-IPAddress] <String> [[-SubnetMask] <String>] [<CommonParameters>]
DESCRIPTION
Get-NetworkAddress returns the network address for a subnet by performing a bitwise AND operation against the
decimal forms of the IP address and subnet mask.
PARAMETERS
-IPAddress <String>
Either a literal IP address, a network range expressed as CIDR notation, or an IP address and subnet mask in a
string.
Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-SubnetMask <String>
A subnet mask as an IP address.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String
OUTPUTS
System.Net.IPAddress
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-NetworkAddress 192.168.0.243 255.255.255.0
Returns the address 192.168.0.0.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-NetworkAddress 10.0.9/22
Returns the address 10.0.8.0.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-NetworkAddress "10.0.23.21 255.255.255.224"
Input values are automatically split into IP address and subnet mask. Returns the address 10.0.23.0.
RELATED LINKS
SYNOPSIS
Get the network address for a network range.
SYNTAX
Get-NetworkAddress [-IPAddress] <String> [[-SubnetMask] <String>] [<CommonParameters>]
DESCRIPTION
Get-NetworkAddress returns the network address for a subnet by performing a bitwise AND operation against the
decimal forms of the IP address and subnet mask.
PARAMETERS
-IPAddress <String>
Either a literal IP address, a network range expressed as CIDR notation, or an IP address and subnet mask in a
string.
Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-SubnetMask <String>
A subnet mask as an IP address.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String
OUTPUTS
System.Net.IPAddress
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-NetworkAddress 192.168.0.243 255.255.255.0
Returns the address 192.168.0.0.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-NetworkAddress 10.0.9/22
Returns the address 10.0.8.0.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-NetworkAddress "10.0.23.21 255.255.255.224"
Input values are automatically split into IP address and subnet mask. Returns the address 10.0.23.0.
RELATED LINKS