33 C
Dubai
Wednesday, April 30, 2025
Home Blog Page 109

10 Useful Basic commands which make life easy for Troubleshooters

1 . To find User Logged in to which domain ?

Set u

image

Running “Set”

Gives all the basic information

2 . To find user resides in which Active Directory Site ?

nltest /dsgetsite

image

3 . To find which DC is Domain Joined system in binding to ?

nslookup

image

4 . To find how many DC’s the Environment has ?

netdom query dc

image

5 . To find where the FSMO roles are ?

netdom query fsmo

image

6 . To Sync all the available Domain Controllers  to the Current DC  ?

(To be run on DC)

repadmin /sycall /Aped

image

7.  To Find DC connectivity is healthy from the Domain Joined Machine ?

dcdiag /s:”DC FQDN”

image

8. To find the Computer name ?

hostname

image

9. To find which are the ports are listening ?

netstat -an | find /i "listening"

image

10 .  To Find the Statistics of the LAN and the Route Table ?

Netstat -Reports

image

To Replicate DNS

dnscmd ny-dc1 /zonerefresh test.contoso.com

To Move Cluster Group

Cluster Group “Cluster Group”/MOVETO:ServerName

Hope its a Useful Blog to have this Commands Handy in One place

 

Exchange Hosting to Exchange 2010 Sp2

Hosting Mode Came to an End , Where No hosting versions of Exchange will be released by Microsoft

Two whitepapers released to get Exchange Migrated to Exchange 2010 sp2

No in place upgrade is possible on both the situations

Migrating Exchange from HMC 4.5 to Exchange Server 2010 SP2

Migrating from Exchange Server 2010 in Hosting Mode to Exchange Server SP2

Download Microsoft White Paper

 

Rapid Migration Guide from Exchange 2003 to Exchange 2010

After a short run we came up with this plan, where getting migration steps in one place and doing it in a systematic procedure.

This Plan should be more suitable for Medium and Small Business environments

Meeting these requirements you can install Exchange 2010:

# Exchange 5.5 Should be completely removed

# Windows Server 2003 native Domain Functional Level and Forest functional level

Domain Functional Level should be at least 2003 Native

https://www.azure365pro.com/how-to-raise-domain-functional-level/

How to Raise Forest Functional Level

https://www.azure365pro.com/how-to-raise-forest-functional-level/

# Exchange 2003 Server has to be in Native mode

https://www.azure365pro.com/how-to-change-exchange-2003-server-to-native-mode/

Now you can install Exchange 2010

Step 1:

Installing Exchange 2010 Sp2 on Windows Server 2008 R2 Sp1 (Coexistence)

https://www.azure365pro.com/installing-exchange-2010-sp2-on-windows-server-2008-r2-sp1/

Step 2:

Creating Send Connector in Exchange 2010 to Send Mails to Internet

https://www.azure365pro.com/creating-send-connector-in-exchange-2010/

Step 3:

Configure Receive Connector in Exchange 2010 to receive Mails to Internet

https://www.azure365pro.com/configure-receive-connector-in-exchange-2010/

Step 4:

Configure Outlook Web App, ActiveSync, Exchange Control Panel (ECP), Configure Outlook Anywhere

https://www.azure365pro.com/configuring-client-access-server-role-migrating-from-exchange-2003-to-exchange-2010/

Configuring Certificates –

3rd Party –

https://www.azure365pro.com/configuring-3rd-party-exchange-certificate-in-exchange-2010/

or

Self-Signed –

https://www.azure365pro.com/how-to-use-a-self-signed-certificate-in-exchange-2010/

Step 5:

How to Move offline address book from Exchange 2003 to Exchange 2010

https://www.azure365pro.com/how-to-move-offline-address-book-from-exchange-2003-to-exchange-2010/

Step 6:

Upgrading Email Address Policies and Address lists from Exchange 2003 to Exchange 2010

https://www.azure365pro.com/upgrading-email-address-policies-and-address-lists-from-exchange-2003-to-exchange-2010/

Step7:

Moving Mailboxes from Exchange 2003 to Exchange 2010

https://www.azure365pro.com/moving-mailboxes-from-exchange-2003-to-exchange-2010/

Step 8:

Moving Public Folders from Exchange 2003 to Exchange 2010

https://www.azure365pro.com/moving-public-folders-from-exchange-2003-to-exchange-2010/

Step 9:

Configure your firewall rules to Exchange 2010 Server (if no smart hosts used)

Public IP NAT to Exchange 2010 IP

If you’re using smart hosts like barracuda, Change it in the (Smart host) barracuda settings

Step 10:

Remove Recipient Update Service

https://www.azure365pro.com/removing-recipient-update-services-using-adsiedit-msc/

Step 11:

Remove Routing Group Connector

Get-RoutingGroupConnector | Remove-RoutingGroupConnector

Say “Y” for Confirmation

image

Step 12:

Uninstall Exchange Server 2003

Open Add or remove programs – Remove Exchange 2003

image

If that fails

Remove Exchange 2003 manually

http://support.microsoft.com/kb/833396

Great !!

You learnt the rapid migration Process from Exchange 2003 to Exchange 2010

Download the Rapid Migration Guide

Happy Migration !!

 

Configuring Client Access Server Role migrating from Exchange 2003 to Exchange 2010

Client Access Server handles all Client Requests

OWA , Outlook , Active Sync , Outlook anywhere , Everything Client request is handled by Client access server only

Will Learn Configuring these things one by one , migrating from Exchange 2003

Outlook Web App –

  • Open EMC, locate and expand Server Configuration in navigation pane
  • Select Client Access from the list.
  • In the result pane select the Exchange 2010 server name.
  • Select Outlook Web App from the work pane, right click and select properties.

image

Now you can set Internal and External Url here

image

or

You can Use Exchange Management Shell

Set-OwaVirtualDirectory -Identity "EXCHANGE2010\owa (Default Web Site)" -ExternalUrl https://mail.careexchange.in/owa -InternalUrl https://Exchange2010.careexchange.in/owa

If you are publishing your Outlook Web App through ISA server or TMG 2010 you need to enable additional logon methods.

Basic Authentication & Integrated Windows Authentication

image

or

You can use Exchange Management Shell

Set-OwaVirtualDirectory -Identity "EXCHANGE2010\owa (Default Web Site-BasicAuthentication:$True -WindowsAuthentication:$True

Exchange Control Panel –

Follow the Exact same process which was followed for Outlook web app

  • Open EMC, locate and expand Server Configuration in navigation pane.
  • Select Client Access from the list.
  • In the result pane select the Exchange 2010 server name.
  • Select Exchange Control Panel from the work pane, right click and select properties

image

Configure your URL’s in the properties pane

image

or You can use Exchange Management Shell

Set-EcpVirtualDirectory -Identity "EXCHANGE2010\ecp (Default Web Site-BasicAuthentication:$True -WindowsAuthentication:$True

If you Enabled Basic Authentication & Integrated Windows Authentication in Outlook web app , have it configured the same for ECP (Exchange Control Panel ) virtual directory as well

image

Configure Microsoft Server ActiveSync –

  • Open EMC, locate and expand Server Configuration in navigation pane.
  • Select Client Access from the list.
  • In the result pane select the Exchange 2010 server name.
  • Select Microsoft Server ActiveSync from the work pane, right click and select properties.

image

Configure your URL’s in the properties pane

image

Or You can use Exchange Management Shell

Set-ActiveSyncVirtualDirectory -Identity "EXCHANGE2010\Microsoft-Server-ActiveSync (Default Web Site)" -InternalUrl https://Exchange2010.careexchange.in/Microsoft-Server-ActiveSync –ExternalUrl "https://mail.careexchange.in/Microsoft-Server-ActiveSync"

Offline Address Book Distribution –

You can set Offline Address book distribution URL

  • Open EMC, locate and expand Server Configuration in navigation pane.
  • Select Client Access from the list.
  • In the result pane select the Exchange 2010 server name.
  • Select Offline Address Book Distribution from the work pane, right click and select properties.

image

Configure your URL’s in the properties pane

image

If you want to know about Polling Interval you refer this link –

https://www.azure365pro.com/how-offline-address-books-works-in-exchange-2010/

or You can use Exchange Management Shell

Set-OabVirtualDirectory -Identity "EXCHANGE2010\OAB (Default Web Site)" -PollInterval 480 -InternalUrl http:// Exchange2010.careexchange.in/OAB -ExternalUrl https://mail.careexchange.in/OAB

Configure Outlook anywhere –

image

image

or You can use Exchange Management Shell

Enable-OutlookAnywhere -Server 'EXCHANGE2010' -ExternalHostname 'anywhere.careexchange.in' -DefaultAuthenticationMethod 'Basic' -SSLOffloading $false

Great !!

You learnt to configure OWA , Exchange Control Panel (ECP), Active Sync , Outlook anywhere, Offline address book distribution

 

Moving Public Folders from Exchange 2003 to Exchange 2010

Moving public folders is simple if your mail flow is fine between Exchange 2003 and Exchange 2010

Cause all the mails are replicated via Email from Exchange 2003 to Exchange 2010

To Add replica and remove Replica from PF folders you can Use

  1. ExFolders
  2. PFDAVadmin (Windows Server 2003 with .net 1.1)
  3. Scripts like AddReplicaToPFRecursive.ps1
  4. Exchange System Manager (Exchange 2003)

If your Public Folder Database Size is too Large I won’t recommend to use scripts because it will add replicas for all the mails

which might create a PF Storm and get your mail flow down . so use tools like Exfolders or Use Exchange System Manager and add replicas , Folder by Folder and Proceed further

Do some basic Checks , that your Email flow is fine between Exchange 2003 to Exchange 2010

If this works you are good to proceed

For Small PF Database you can go ahead and use Scripts

This will add replica of public folders on Exchange Server 2003 to Exchange Server 2010.

Open your Exchange Management Shell , Browse your prompt into the Scripts folder

and you can run this command

.\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\" -ServerToAdd "Exchange2010"

Hold On,,,Wait for sometime. Because your PF emails are Less priority Emails it will take sometime to replicate

You can check the PF database size on both the ends and verify , It won’t be the exact same

cause the database structure is different

Once that completes . Dismount your PF database in your Exchange 2003 and Try to access data from your Exchange 2010 Mailbox

This verifies Your data has been replicated fine

Now you can run this script ,

CAUTION : Be cautious , Before doing this . make 100 % sure that your PF database is replicated fine to the Exchange 2010 , You can verify by turning off Exchange 2003 or Dismounting Exchange 2003 PF database

Once the replica is added and data has been replicated over to finish of the PF migration

we got to move the replica from Exchange 2003 to Exchange 2010.

Open your Exchange Management Shell , Browse your prompt into the Scripts folder

and you can run this command

.\MoveAllReplicas.ps1 -Server "Exchange2003" -NewServer "Exchange2010"

Great !! your PF migration is done !!

One more Last Step

Moving Folder Hierarchies

You got to move this so that your Public Folders will be completely migrated to Exchange 2010

Open your Exchange System Manager

Right click on Exchange Administrative Group –> New –> Public Folders Container

image

Now you Can See Public Folders Container (Folders)

Expanding First Administrative Group you can see “Public Folders”

image

Now Click and Drag “Public Folders”  from

First Administrative Group (Folders) to Exchange Administrative Group (Folders) container

image

Great !!

Your PF Folders are completely migrated

 

Create a Custom root Folder in all the Mailboxes (Bulk) in Exchange 2010

 Download Script –

CustomRootFolder.ps1

Refer the below link for the original script , and Customized it a little

http://blogs.msdn.com/b/akashb/archive/2011/07/23/creating-folder-using-ews-managed-api-1-1-from-powershell.aspx

And Please Test in your lab – Before proceeding into your live Environment

There is a a good script where we can use to create a Custom root Folder in all the Mailboxes in your environment.

Were we can create Custom Folders Like below for single mailbox and for all the mailboxes in Bulk

image

Prerequisites –

Download and Install in your Server

Exchange Web Services Managed API

http://www.microsoft.com/download/en/details.aspx?id=13480

——

Add the User to the “ApplicationImpersonation” Role assignment

New-managementroleassignment –Role “ApplicationImpersonation” –user administrator 

image

Now you can go ahead and use the script—

Please Try for the One Mailbox – And Please Test in your lab – Before proceeding into your live Environment


[string]$info = "White"                # Color for informational messages
[string]$warning = "Yellow"            # Color for warning messages
[string]$error = "Red"                 # Color for error messages
[string]$LogFile = "C:\Temp\Log.txt"   # Path of the Log File

function CreateFolder($MailboxName)
{
Write-host "Creating Folder for Mailbox Name:" $MailboxName -foregroundcolor  $info
Add-Content $LogFile ("Creating Folder for Mailbox Name:" + $MailboxName)

#Change the user to Impersonate
$service.ImpersonatedUserId = new-object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress,$MailboxName);

#Create the folder object

$oFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
$oFolder.DisplayName = $FolderName

#Call Save to actually create the folder
$oFolder.Save([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::msgfolderroot)

Write-host "Folder Created for " $MailboxName -foregroundcolor  $warning
Add-Content $LogFile ("Folder Created for " + $MailboxName)

$service.ImpersonatedUserId = $null
}

#Change the name of the folder
$FolderName = "Customer Folder Name"
Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange.WebServices.dll"

$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP1)

# Set the Credentials
$service.Credentials = new-object Microsoft.Exchange.WebServices.Data.WebCredentials("Administrator","Type your Password Here","careexchange.in")

# Change the URL to point to your cas server
$service.Url= new-object Uri("https://localhost/EWS/Exchange.asmx")

# Set $UseAutoDiscover to $true if you want to use AutoDiscover else it will use the URL set above
$UseAutoDiscover = $false
$a = get-mailbox

$a | foreach-object {
$WindowsEmailAddress = $_.WindowsEmailAddress.ToString()

#if ($UseAutoDiscover -eq $true) {
# Write-host "Autodiscovering.." -foregroundcolor $info
#$UseAutoDiscover = $false
$service.AutodiscoverUrl($WindowsEmailAddress)
#Write-host "Autodiscovering Done!" -foregroundcolor $info
# Write-host "EWS URL set to :" $service.Url -foregroundcolor $info

# }
#To catch the Exceptions generated
# trap [System.Exception]
# {
#    Write-host ("Error: " + $_.Exception.Message) -foregroundcolor $error;
#     Add-Content $LogFile ("Error: " + $_.Exception.Message);
#     continue;
# }
CreateFolder($WindowsEmailAddress)
}

Do the Edits Required in the Script —

****

msgfolderroot denotes the Root of the Mailbox , If you specify inbox for example it creates the folder below the inbox

****

Change your

User name – Password – Domain Name –

****

$a = get-mailbox  denotes all the mailbox

To Run for a single mailbox (use the alias)

$a = get-mailbox  “User1”

Save it a Notepad and Rename it to .ps1 file

And Open Power shell locate your powershell into the folder you saved the script

.\create.ps1 for example

image

 Download Script –

CustomRootFolder.ps1

Great !!

You learnt how to create Custom root folders in all the mailboxes

 

× How can I help you?