Author Archives: Krishna - MVP
Powershell to create new A Record and MX record into DNS
Powershell to Add A record and MX record into DNS. Add all the values which are given in <>
$ServerName = <DNS ServerName>
$MXrec = [WMIClass]”\\$ServerName\root\MicrosoftDNS:MicrosoftDNS_MXType”
$server = “<DNSservername>”
$OwnerName = “<domain.Example>”
$ContainerName “<domain.Example>”
$RecordClass = $Null
$TTL = $Null
$Preference = 10
$MailExchange = “mail.domain.Example”
$$MXrec.CreateInstanceFromPropertyData($ServerName, $ContainerName,’
$OwnerName, $RecordClass, $TTL, $Preference, $MailExchange
$Arec = [WmiClass]”\\$ServerName\root\MicrosoftDNS:MicrosoftDNS_AType”
$server = “<DNSservername>”
$zone = “<zoneName>”
$name = “ArecordServerAddress”
$class = 1
$ttl = 3600
$address = “IPAddress”
$Arec.CreateInstanceFromPropertydata($server, $zone, $name, $class,’
$ttl, $address)
Powershell to Ping Given Rage of IP Address and Get the Status
Below Powershell helps to ping given set of ip address and get the result status and also provides the status of number of machines which are rechable
$ping = New-Object System.Net.NetworkInformation.Ping
$i = 0
1..255 | foreach { $ip = “192.168.1.$_”
$Res = $ping.send($ip)
if ($Res.Status -eq “Success”)
{
$result = $ip + ” = Success”
Write-Host $result
$i++
}
$Hosts = [string]$i + ” Hosts is pingable”
Write-Host $Hosts
Prepare Active Directory and Domains for Exchange 2007 Installing and Permissions Requied
Powershell to Pull out Exchange 2007 Mount Free Disk Details
In Exchange 2007 We have may have lots of DBs which we land up in creating multiple mount points instead of Drives for each Logs and Database. Below script helps to pull out the size and free size of all the mount point of the database . Change the servername and for loop with the number of Database you have.
$K = gwmi win32_volume -computername “Servername” |where-object {$_.name -like “C:\Mountpoints\DB*”}|select name,capacity,freespace
for ($i=0; $i -le 22; $i++)
{
$name = $K[$i].name
$Capacity = [math]::truncate($K[$i].capacity/1gb)
$freespace = [math]::truncate($K[$i].freespace/1gb)
$L = $name + ” ” + $Capacity + ” ” + $freespace
write-output $L
}
Powershell check if Remote Machine Required Port is opened or Not
Need to make sure that PortQry is downloaded from the microsoft site and use below powershell script to check the same
$Servername = Read-Host “Enter the Servername”
$PortNumber = Read-Host “Enter the Port Number”
$K = .\PortQry.exe -n $Servername -e $PortNumber -p TCP
$L = $K -Match “LIS?”
If($L -ne $null)
{
$res = $servername + ” has ” + $PortNumbe + “Opened”
Write-Host $res
}
Else
{
$res = $servername + ” has ” + $PortNumbe + “Closed”
Write-Host $res
}
PortQuery to Check Port Status on Remote and Local Computer
Download the copy of the portQry from the below link
Below command checks if Remote computer TCP Port 445 is open or closed
PortQry.exe -n <IPAddress> -e 80 -p TCP
Below command checks if Remote computer UDP Port 445 is open or closed
PortQry.exe -n <IPAddress> -e 80 -p TCP
Below command checks if Remote computer TCP and UDP Port 445 is open or closed
PortQry.exe -n <IPAddress> -e 80 -p BOTH
Below command check if all the local computer port is open
PortQry.exe -local
Uninstalling Exchange 2003 cluster Server
Make sure that Following is not residing on Exchange 2003 which you wanted to decomission
1. No mailbox
2. Configure public Folder replica to other servers
3. Configure Free busy and OAB information to replication to other public folder
4. Move Offline Address book to other Exchange Server
5. Move RUS to other Exchange Server
6. Make sure Decomission server is not Bridge Head Server or Routing Group Master Server
Login to Active Node of Exchange Server
1. Open Cluster Admin
2. Open Exchange Cluster resource and take offline all the resources Except Exchange name and Exchange IP address
3. Right click on Exchange System Attendent Cluster Resource -> Click on Remove Exchange Virtual Server and click on OK to confirm the same
4. Once you remove System Attendent Cluster resource loging to passive node and Add remove programs to remove Exchagne 2003
5. Once passive node is done then login to Active node and uninstall Exchange Server
6. If you could not uninstall Exchange 2003 Gracefully then
7. Stop All the Exchange resources and change to startup type to Disabled
8. Open Registery Editor and remove all the exchange related information
9. Delete Exchange Setup folders in the path C:\program files\Exchsrvr
10. Open Adsiedit then Access configuration Container and browse to the below path and right click on the Exchange 2003 server object and delete
Configuration Container
CN=Configuration, DC=Domain_Name,DC=com
CN=Services
CN=Microsoft Exchange
CN=Your_Organization_Name
CN=Administrative Groups
CN=Your_Administrative_Group_Name
CN=Servers
11. Link http://support.microsoft.com/kb/833396 has some details information on the details on the services that needs to be stopped,registery that needs to be deleted for step 7 and 8 above
12. Reinstall IIS on both the server
Exchange 2007 IMAP and POP Protocol Logging
IMAP and POP Protocol logging is made easy in Exchange 2007. Below are the step by step to enabled the same.
1. Login to Exchange 2007 client access server
2. Browse to C:\Program Files\Microsoft\Exchange Server\ClientAccess\PopImap
3. Open Microsoft.Exchange.Imap4.exe.config with notepad
4. Find the <addkey=”ProtocolLog” value=”false” /> in the file
5. Change False to True
6. Below link <add key=”LogPath” value=”C:\Program Files\Microsoft\Exchange Server\Logging\Imap4″ /> is the path of the Imap4 log file location
7. Restart MSExchangeIMAP Service
Configure GALSync (ILM 2007 SP1) Between Exchange 2007 Cross forest
Domain Setup
A Domain
1. One DC with DNS
2. One Exchange 2007 with CAS,HUB and Mailbox Server roles installed
K Domain
1. One DC with DNS
2. One Exchange 2007 with CAS,HUB and Mailbox Server roles installed
3. Windows 2003 for ILM 2007 SP1 – Prereqists Powershell, Exchange 2007 Management , Exchange 2005 – With SP1
To configure Mail flow between forest
1. Configure DNS forwared for A.com and K.Com for DNS resolution
2. Login to ADC and open DNS Services and Properties
3. Forwarders and IP address for K.com
4. Once this is done perform the same steps on KDC and configure forderwares for A.com
5. Then configure forest trust. Open Active Directory Domain and trusts on KDC to configure two way forest trust between two forest
6. Create Internal Send Connector between two exchange forest
http://technet.microsoft.com/en-us/library/bb123546.aspx
7. Create OU for GALsyncronisation in both the domain. Below is the OU Path to dump the contacts from the Target Forest
OU=Contacts,OU=K,OU=GALSyncronisation,DC=A,DC=Com
OU=Contacts,OU=A,OU=GALSyncronisation,DC=K,DC=Com
8. Login to Ksync make sure that you have installed with Powershell 1.0, Exchange 2007 management console and SQL 2005 SP1
9. Install ILM 2007 SP1 default isntallation
10. Open Identity Manager
11. Click on Management Agents and click Create
12. Select Active Directory Global Address List(GAL) and provide the appropriate Name
13. Enter the domain name , forest name and credentials for target domain click next to continue
14. On Configure Directory Partition select Containers. On the Select Containers page, clear the top-level check box for the directory partition, select the containers for which this management agent will gather and store information, and then click OK. Make sure that you point to OU=Contacts,OU=A,OU=GALSyncronisation,DC=K,DC=Com
15.Select the Target path as show below and click on Source to Select the source ou where users , contacts and groups are residing. Make sure that Route mail throught this forest for all the contact from the contacts in this forest and Support Cross-Forest delegation(Exchange 2007 only) is checked
16. Click Next until you get the last page Configure Extention and make sure that you Check Enable Exchange 2007 Provisioning and click finish
17. Create the Similar Management Agent AGAL for sync objects from K domain to A domain. Below is the snap of the Management Agents for both the domain
18. Right click on each of the MA Created above and select run and select blow option one by one
Full Import (Staging Only)
Full Synchronization
Export
Delta Import
19. This completes our Configuration of ILM. Select an Each of the domain to make sure that Contacts are created in the target forest for the respective objects from the source forest
20. Reference Articles