concept subnet in category powershell

This is an excerpt from Manning's book PowerShell in Practice.
We start by creating the object
. There are only three pieces of data that we present using this technique: the server name, the zone
, and the record text
. The zone is a reverse lookup zone, so its name includes the subnet reversed. The text gives the reversed IP address of the system and the machine name. The CreateInstanceFromTextRepresentation()
method is used to perform the creation.
Active Directory subnets define the range of IP addresses available within a site. They’re used by clients to determine site membership. The final elements in the topology are site links, which are used to control replication between domain controllers in different sites.
This section is about creating subnets in Active Directory, not about the subnetting of networks. A subnet is linked to an Active Directory site and defines the range of IP addresses Active Directory expects to see in that site. They’re used to enable newly promoted domain controllers to determine in which site they belong.
The .NET ActiveDirectorySubnet class solves this problem for us, as shown in listing 11.16. The first three lines of the script get the forest
, and use a forest context type
to create a forest context
. We then set the data we’ll use to create the subnet
. The site name and subnet name must be given; the location is optional.
Listing 11.18 shows a solution similar to that presented in section 11.3.4. Simply get the ADSI object for the subnet and call the DeleteTree() method as shown.
. There are only three pieces of data that we present using this technique: the server name, the zone
, and the record text
. The zone is a reverse lookup zone, so its name includes the subnet reversed. The text gives the
method is used to perform the creation.