Archive for December 2012

NCPA.CPL How many people knows this ? If you are a system administrator , you defininately know this.

It’s indeed a tedious task to go to the NIC ——>Property and put the IP address , DNS Address and DNS Search Suffixes , Wins Address Manually . So , I though lets build a PowerShell script which will make administrator life easy . Below is the script

$IP = Read-Host “Please Enter the IP Address”
$Subnet = Read-host “Please Enter the SubnetMask”
$default = Read-host “Please Enter DefaultGateway”
$dns = “”,”″
$DNSsuffix =  “”,””
$a = Get-WmiObject -Class win32_networkadapterconfiguration -Filter “IPEnabled = true”
$a.EnableStatic($IP , $Subnet)
invoke-wmimethod -Class win32_networkadapterconfiguration -Name setDNSSuffixSearchOrder -ArgumentList @($DNSSuffixes),$null 

Script should be modified according to your environment. Below are the which one need to modify

$dns = “”,”″
$DNSsuffix =  “”,””

Read – host command line will ask you to provide IP address,SubnetMask,Defaultgateway in CMD Prompt

Hope this script will help to remove manual work