Difference between revisions of "Create a new ad forest, Microsoft Article"

From MyWiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
Set-DnsClientServerAddress -InterfaceAlias “Wired Ethernet Connection” -ServerAddresses 192.168.0.1, 192.168.0.2  ?? <br>
 
Set-DnsClientServerAddress -InterfaceAlias “Wired Ethernet Connection” -ServerAddresses 192.168.0.1, 192.168.0.2  ?? <br>
 
'''Change ip address:'''<br>
 
'''Change ip address:'''<br>
New-NetIPAddress –InterfaceAlias “Ethernet” –IPv4Address “192.168.0.33” –PrefixLength 24 -DefaultGateway 192.168.0.1  - no good<br>
+
New-NetIPAddress –InterfaceAlias “Ethernet” –IPAddress “192.168.0.33” –PrefixLength 24 -DefaultGateway 192.168.0.1  - no good<br>
 
'''Get adapter details:'''<br>
 
'''Get adapter details:'''<br>
 
Get-Netadapter<br>
 
Get-Netadapter<br>
 
'''Removing ip addresses:'''<br>
 
'''Removing ip addresses:'''<br>
 
https://docs.microsoft.com/en-us/powershell/module/nettcpip/remove-netipaddress?view=win10-ps<br>
 
https://docs.microsoft.com/en-us/powershell/module/nettcpip/remove-netipaddress?view=win10-ps<br>
 +
<br>
 +
'''Getting the ip address:'''<br>
 +
Get-Netipaddress -interfaceindex 12 | select Ipaddress<br>
 +
<br>
 +
'''An example of getting the current ip address:'''<br>
 +
$ipaddress = $(ipconfig | where {$_ -match 'IPv4.+\s(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' } | out-null; $Matches[1])<br>

Latest revision as of 18:12, 10 December 2017

Reference - https://blogs.technet.microsoft.com/heyscriptingguy/2013/01/03/use-powershell-to-deploy-a-new-active-directory-forest/
Configure the dns server using Powershell:
Set-DNSClientServerAddress -interfaceIndex 12 -ServerAddresses ("192.168.0.1","8.8.8.8")
Set-DnsClientServerAddress -InterfaceAlias “Wired Ethernet Connection” -ServerAddresses 192.168.0.1, 192.168.0.2  ??
Change ip address:
New-NetIPAddress –InterfaceAlias “Ethernet” –IPAddress “192.168.0.33” –PrefixLength 24 -DefaultGateway 192.168.0.1 - no good
Get adapter details:
Get-Netadapter
Removing ip addresses:
https://docs.microsoft.com/en-us/powershell/module/nettcpip/remove-netipaddress?view=win10-ps

Getting the ip address:
Get-Netipaddress -interfaceindex 12 | select Ipaddress

An example of getting the current ip address:
$ipaddress = $(ipconfig | where {$_ -match 'IPv4.+\s(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' } | out-null; $Matches[1])