The script takes
the old interface name ($Interface2) and renames it ($Interface2_New) . From there the NIC
receives an IP address ($IP) and subnet mask ($Subnet) . The next step sets the DNS server to null,
and removes the checkbox to automatically register this connection in DNS. Once all of the configuration
parameters are set, the last line of the script enables the new interface. (See Figure 13 - 7 .)
Figure 13-7
Part III: Working with PowerShell in a Production Environment
372
Preparing the Shared Disk
Before any disk can be presented to the OS, a partition must be created, followed by a disk letter, file
system type, and a volume name. Mount points can be used in place of disk letters. For more
information on how to configure mount points in a Microsoft Cluster, see Microsoft kb article 280297.
The following snippet shows how you can use PowerShell to create variables to automate the work of
creating and formatting disks:
$Disk=???C:\disk.txt???
$Disk1=???1???
$Disk1_Letter=???Q???
$Disk2=???2???
$Disk2_Letter=???S???
$Disk3=???3???
$Disk3_Letter=???T???
Set-Content -path $Disk -encoding ascii -value ???select disk $Disk1 `r
create partition primary align=32 `r
select partition 1 `r
assign letter=$Disk1_Letter `r
select disk $Disk2 `r
create partition primary align=32 `r
select partition 1 `r
assign letter=$Disk2_Letter `r
select disk $Disk3 `r
create partition primary align=32 `r
select partition 1 `r
assign letter=$Disk3_Letter???
This script contains variables for each disk in the array and uses the set-content cmdlet to create the
text file.
Pages:
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522