Script

# Change time to IST

Set-TimeZone -Name “India Standard Time” 

# Enable firewall to ping server each other :-

 New-NetFirewallRule -DisplayName "Allow ICMPv4-In" -Protocol ICMPv4

 

# PowerShell command to install ISS

# install IIS server role

 Install-WindowsFeature -name Web-Server -IncludeManagementTools


 # remove default htm file

  remove-item  C:\inetpub\wwwroot\iisstart.htm


 # Add a new htm file that displays server name

  Add-Content -Path "C:\inetpub\wwwroot\iisstart.htm" -Value $("Hello World from " + $env:computername)

 

 

# Powershell command to install google chrome

 

$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object    System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor =  "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)

 

 

 

# Replace DC name

Rename-Computer -NewName PDC

 

# Install the Active Directory Domain Services role

Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools

 

# Configure the first domain controller in a new Active Directory forest

 

Install-ADDSForest -DomainName azadds.info -DomainNetBIOSName AD -InstallDNS

 

 

# Command to check public ip Address :-

 

Invoke-WebRequest ifconfig.me/ip  

 


Comments

Popular posts from this blog

Landing Zone

Migration