Examples of Network Administration Tasks: Previous One
Examples of Network Administration Tasks: Previous One
one include some short e cerpts from my book to both whet your appetite !to entice you into buying my book" and to show you some of the things you can do as an admin using PowerShell# $ote that the target audience of the book is Windows intermediate% level admins who have several years of work e perience but who might still be beginners when it comes to using PowerShell, so &'m hoping that readers will find my book useful to learn how they can start using PowerShell to simplify and automate the administration of Windows servers in their environment# (his second e cerpt is from )hapter * $etwork +dministration and shows how you can manage Windows Server 2012 ,$S servers using PowerShell# &'ve also included one of the chapter's e ercises, which shows how you can configure a caching%only ,$S server using PowerShell# $ote that these book e cerpts haven't finished going through the editorial review process yet, so they may change a bit in the published version#
(o view a list of resource records of type + !address" in the corp#contoso#com .one, we can pipe the output of the 1et%,nsServer2esource2ecord cmdlet into the Where%3b4ect cmdlet like this0
PS C:\> Get-DnsServerResour#eRe#ord -ZoneName #orp$#ontoso$#om - .,ere-/01e#t 23"$Re#ordType -e4 5A56 7ostName -------8 A 8 A Doma!nDnsZones Doma!nDnsZones %orestDnsZones %orestDnsZones sea-srv-( S>A-SR?-+ Re#ordType T!mestamp T!meToL!ve Re#ordData ---------- --------------------------*9:9)'() ():'':'' P; '':(':'' (*)$(<$(($=< *9:9)'() (:'':'' P; '':(':'' (*)$(<$(($)=) A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($=< A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($)=) A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($=< A *9:9)'() ():'':'' P; '':(':'' (*)$(<$(($)=) A ' '(:'':'' (*)$(<$(($)=) A ' '(:'':'' (*)$(<$(($=<
(o add a new + resource record for a test server, you can use the +dd% ,nsServer2esource2ecord+ cmdlet like this0 PS )056 +dd%,nsServer2esource2ecord+ %&Pv7+ddress 182#1*#11#29: %$ame S;+%(;S( %<one$ame corp#contoso#com -ou can also add other types of resource records such as P(2, )$ or M= records using the above cmdlet# +nd you can use the 2emove%,nsServer2esource2ecord cmdlet to remove resource records from a .one# (here are over one hundred different cmdlets in the ,nsServer module for Windows PowerShell in Windows Server 2012# (able 1 shows the cmdlets you can use to perform some common ,$S administration tasks# -ou'll get some hands%on e perience with using some of these cmdlets in the practice e ercises for this chapter# TASK )onfigure forwarders )reate a stub .one ,isplay the contents of the ,$S server cache )lear the ,$S server cache ,isplay full configuration details of the ,$S server ,isplay statistics for the ,$S server &mport root hints )onfigure the ,$S server cache settings )onfigure ,$S server scavenging &nitiate scavenging CMDLET +dd%,nsServer/orwarder +dd%,nsServerStub<one Show%,nsServer)ache )lear%,nsServer)ache 1et%,nsServer 1et%,nsServerStatistics &mport%,nsServer2oot>int Set%,nsServer)ache Set%,nsServerScavenging Start%,nsServerScavenging
Table ! Some common ,$S server administration tasks and the Windows PowerShell cmdlets you can use to perform them#
E# Cse the command Show%,nsServer)ache %)omputer$ame S;2@;22 and note that the ,$S server cache now contains numerous entries relating to the name Buery you performed using nslookup# :# )lear the ,$S server cache on S;2@;22 by running the following command0 )lear%,nsServer)ache %)omputer$ame S;2@;22 10# ,isplay the contents of the ,$S server cache on S;2@;22 again by running this command0 Show%,nsServer)ache %)omputer$ame S;2@;22 11# $ote that the cache entries relating to the name Buery you performed using nslookup have now been deleted# (he only entries that remain in the cache are those for the root hints configured on the server# 12# (o speed up name resolution on your caching%only name server, you will configure S;2@;21 as a forwarder on S;2@;22# 3nce you have done this, any name Buery sent to S;2@;22 will be forwarded to S;2@;21 which will then use its e ternal forwarders at your &nternet Service Provider !&SP" for resolving the Buery# 19# )onfigure S;2@;21 as a forwarder on S;2@;22 by running the following command0 +dd%,nsServer/orwarder %&P+ddress 10#10#0#1 %)omputer$ame S;2@;22 17# @erify the result by displaying the forwarders configured on S;2@;22 as follows0 1et%,nsServer/orwarder %)omputer$ame S;2@;22 1A# Cse nslookup to perform another name Buery against S;2@;22 for the /D,$ www#bing#com# (he response should be received almost immediately with no ,$S server time outs occurring# (his is because the Buery was forwarded to S;2@;21 which then forwarded it to your &SP's ,$S servers for resolution# (his approach is generally much faster than using the &nternet root name servers to reclusively resolve the reBuested /D,$# 1*# ,isplay the contents of the ,$S server cache on S;2@;22 again# $ote the cache entries relating to your name Buery, and note also that there are considerably fewer cache entries than when root hints alone were used for performing recursive name resolution#
Co