Wednesday, November 11, 2015

All Exchange server 2013 services not able to start

Description:

The Exchange services not able to restart and have the following event logs

Event ID: 10006
Source:  MSExchange Mid-Tier Storage
Description: Active Manager Client experienced an AD timeout trying to lookup object '' in 00:01:00.

Event ID: 2142
Source: MSExchangeADTopology 
Description: Process Microsoft.Exchange.Directory.TopologyService.exe (PID=) Forest Domain.com. Topology discovery failed, error details. No Minimal Required Number of Suitable Directory Servers Found in Forest Domain.com Site RNS and connected Sites..

Cause:
 Misconfiguration of the Active Directory Global Catalog as we have two options in order to make the Active directory work properly with Exchange which is at the same AD site:
Option 1: Have one Global Catalog server for Each site
Option 2: Have all Active Directory servers a Global Catalog

So incase we have four AD in the same site we cannot have only three of them Global Catalog servers.

Resolution:
Make sure you have correct number of the Global Catalog servers at this site

Friday, September 11, 2015

Prevent Users From Deleting Emails From A Shared Mailbox

To let users only review emails but unable to edit/remove emails in shared mailbox, you can setup the shared mailbox by following the steps below,

1 - Remove the user from the group which has been granted the full access permission on the shared mailbox,
2 - Open the shared mailbox in Outlook with another account who has full access permission on the shared mailbox,
3 - Right click the shared mailbox, click Data File Properties, in Permission tab, click add to add a user, and choose reviewer from the Permission level drop down list,
4 - Right click the inbox folder of the shared mailbox, click Properties, in Permission tab, click add to add the same user, and choose reviewer from the Permission level drop down list,



Then this user can open the shared mailbox in Outlook as usual but only able to view the emails in inbox and unable to edit/remove emails.

Delete a spam or specific Message from all mailboxes on Exchange 2010

The following two method that you can use to delete a spam or specific message from all Mailbox on your exchange server 2010:

Method #1:
Run the following PSCMD for each exchange server that you have, to delete the message with the following criteria (Subject / From | Received / Date).

Get-Mailbox -Database “mailbox server” | Search-Mailbox  -targetmailbox backupmailbox -targetfolder “DeletedMSG” -SearchQuery {Subject:"the subject of the target message" AND From:"Sender email address" AND Sent:"02/12/2014 12:45:00"} -loglevel full -DeleteContent

Method #2:
Run the following two small PS scripts to track and delete the messages.


Tracking:
-----------------
$x = Get-ExchangeServer | where {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-MessageTrackingLog  -messagesubject "security"  -eventid “deliver” -Start "02/12/2014 12:45:00 PM" -end "02/12/2014 12:47:00 PM" -resultsize "unlimited"
$y = $x|select timestamp, sender, @{l="Recipients";e={$_.Recipients -join " "}}, messagesubject, serverhostname, messageid |Sort-Object -Property timestamp
$y|export-csv c:\temp\tracking.csv

Deletion :
------------
$x=get-content c:\OrderInvoice.txt
foreach ($y in $x)
{
$result=$null
$count=$null
$result=Search-Mailbox -identity $y -SearchQuery 'subject:"OrderInvoice" AND Received:23/11/2014' -DeleteContent -force -resultsize unlimited
$count=$result.ResultItemsCount
add-content C:\result.txt "$count`n"
}
 

Tuesday, May 26, 2015

Repair a suspect Database in SQL

Problem:
Cannot access the SQL database
Cause:
The SQL database is tagged as (suspect) and become corrupted due an unexpected SQL Server Shutdown or power failure.
Resolution:
1.       Open Microsoft SQL Server Management Studio and connect to your database
2.       Click the New Query button
3.       Paste the following SQL script into your New Query.
EXEC sp_resetstatus [Maxreports];
ALTER DATABASE [Maxreports] SET EMERGENCY
DBCC checkdb([Maxreports])
ALTER DATABASE [Maxreports] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ([Maxreports], REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE [Maxreports] SET MULTI_USER
4.       Click Execute

Now you should able to access the database :)

Thursday, February 26, 2015

SP 2013: Distributed Cache Service does not support this operation from Central Administration. Please use Sharepoint Powershell commandlets.

Problem:
You cannot change SharePoint Server 2013 Distributed Cache service account using Central Admin site

Resolution:
Use the following PowerShell CMD to Change the managed service account for the distributed cache.

$farm = Get-SPFarm
$cacheService = $farm.Services | where {$_.Name -eq "AppFabricCachingService"}
$accnt = Get-SPManagedAccount -Identity Domain\needed-service-account
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$cacheService.ProcessIdentity.ManagedAccount = $accnt
$cacheService.ProcessIdentity.Update()
$cacheService.ProcessIdentity.Deploy()

Thursday, February 19, 2015

Cannot create virtual machine on System Centre Virtual Machine Manager 2012 R2

Problem: 
Receiving the following Error whenever you try to create VM from the VMM console.

Error (2915)
The Windows Remote Management (WS-Management) service cannot process the request. The object was not found on the server (VMM Server Name).

WinRM: URL: [http://VMM Server Nam:5985], Verb: [ENUMERATE], Resource: [http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/Msvm_VirtualSystemManagementService], Filter: []

Unknown error (0x80338000)

Recommended Action
Ensure that the VMM agent is installed and running. If the error persists, restart the virtualization server (VMM Server Name) and then try the operation again. 

This error can also happen due to an older version of the VMM agent on the virtualization server. Ensure that the VMM agent is upgraded to the latest version, and then try the operation again.

Resolution:

Run the following PowerShell CMDs on all you Hyper-V hosts

1- Import-Module FailoverClusters
2- Get-ClusterResource -c YouHyper-VClusterName | where {$_.resourcetype.name -eq ‘virtual machine configuration’} | Update-ClusterVirtualMachineConfiguration

Thursday, September 25, 2014

Exchange 2013 SP1 CU5: Content index of mailbox databases in Unknown state........and OWA users cannot do search on their mailboxes

Problem: Some user cannot search on their mailboxes using OWA

Cause: Content index of all databases on mailbox servers is not working and showing “Unknown” state.

Resolution: Applying the following actions on above failed mailbox servers.
Ø  Recreate the Search Foundation from scratch
a.       Stop and disable the search services and rename the Data Folder  "C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\HostController\Data"
b.      Open power shell and navigate to C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Installer
c.       Run the command :  .\installconfig.ps1 -action I -dataFolder "c:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\HostController\Data"
d.      Output should be like
                                                               i.      [PS] C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Installer>.\installconfig.ps1 -action I -dataFolder "C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\HostController\Data"
                                                             ii.      Configuring Search Foundation for Exchange....
                                                            iii.      Successfully configured Search Foundation for Exchange
e.      Rename the Index files for the database that are active on the node .
f.        Start the Search Services

Ø  Removed a configuration entry that refers to the ContentSubmitters group. This entry is present in four XML files. Each file is called WcfConfigurator.
a.       you can find each file in the following folder: %ExchangeInstallPath%\Bin\Search\Ceres\HostController\Data\Nodes\Fsis\NODENAME\Configuration\Local
b.      Here, “%ExchangeInstallPath%” is the Exchange installation root path, and the placeholder NODENAME represents one of the following names. (There is one name for each of the four files that are to be edited.)
§  AdminNode1
§  ContentEngineNode1
§  IndexNode1
§  InteractionEngineNode1

                                                         i.            These are text files. You can use Notepad or any other convenient plain text editor to change them. Make sure that you make only the change that is described here.
                                                       ii.            Each file contains at most one line that contains the following: <AuthorizedRole>ContentSubmitters</AuthorizedRole>
                                                      iii.            Remove this line, and then save the file. Repeat this operation for each of the four files, and then restart the Microsoft Exchange Search Host Controller service.
c.       Found the Index files in Crawling state as expected instead of Unknown.


Ø  Once all the Active copies are healthy and still the copies in failed and suspended state, then you can reseed the catalog files only using the below command


Update-MailboxDatabaseCopy -Identity DB\MBserver –CatalogOnly 

Friday, July 4, 2014

Lync 2013 WAC - Either the network connection has been lost or the server is busy. please check your network connection.

In case you are publishing your WAC servers using TMG you might face the following,

Problem:
PowerPoint presentations not working and showing only (white screen) for External Users and a while it showing the following error message.
Either the network connection has been lost or the server is busy. please check your network connection.

Resolution:


  1. In Forefront TMG, right-click the name of the new publishing rule and then click Properties.
  2. In the Properties dialog box, on the To tab, select the option Forward the original host header instead of the actual one.
  3. On the Traffic tab, click Filtering and then click Configure HTTP.
  4. In the Configuring HTTP policy for rule dialog box, clear the Verify normalization check box and then click OK.
  5. In the Properties dialog box, click OK.
  6. In Forefront TMG, click Apply to enable the changes. When the Configuration Change Description dialog box appears, click Apply.




Monday, June 23, 2014

Sorry, We ran into a problem displaying the presentation. Please try again.

Problem:
After installing Office Web App Server 2013 on Windows 2012 R2 using this article when you share any PowerPoint presentation the presentation will open and work only on the presenter client and all attendees will get that error "Sorry, We ran into a problem displaying the presentation. Please try again."



Resolution:
Install the follwong Office Web App 2013 hotfix package on your WAC servers
http://support.microsoft.com/kb/2825686/en-us

Saturday, May 24, 2014

Exchane 2013: Change the Location of the Queue Database


  1. Create the folders where you want to keep the queue database and transaction logs. Make sure that the correct permissions are applied to the folders.

  1. In a Command prompt window, open the EdgeTransport.exe.config file in Notepad by running the following command:
Notepad %ExchangeInstallPath%Bin\EdgeTransport.exe.config



  1. Modify the following keys in the <appSettings> section.
<add key="QueueDatabasePath" value="<LocalPath>" />
<add key="QueueDatabaseLoggingPath" value="<LocalPath>" />




  1. When you are finished, save and close the EdgeTransport.exe.config file.
  2. Restart the Microsoft Exchange Transport service by running the following command:
net stop MSExchangeTransport && net start MSExchangeTransport



Note: If the Exchange Transport Service didn’t started again after running above command go to Services  and start it manually





To verify that you successfully created a new queue database and new transaction logs at a new location, do the following:
  1. Verify the new database files Mail.que and Trn.chk exist at the new location.
  2. Verify the new transaction log files Trn.log, Trntmp.log, Trnres00001.jrs, Trnres00002.jrs, and Temp.edb files exist at the new location.
  3. If you can delete the old queue database and transaction log files from the old location after the Microsoft Exchange Transport service has started, those files are no longer being used.

Reference:
http://technet.microsoft.com/en-us/library/bb125177(v=exchg.150).aspx

Monday, May 19, 2014

Exchange DAG Database Incremental Backup From Passive Databases Fails to Purge the Logs

Resolution:


1-      Make sure that the Database copy on all Mailbox server in healthy state.
2-      Dismount the active copy of the Database.
3-      Suspend replication for the target Database.
4-      Dump the database header to make sure it’s in clean shutdown using  “ESEutil /mh”.



5-      Move the log files ( .log) from the logs folder to alternate location on the Server that hold the active copy database.
6-      Mount the DB. make sure it is mounted successfully with healthy state.
7-      Resume the Passive Database Replication.



8-      In-case you got error when resuming the passive Database replication with “Failed and suspended” state, start reseeding the Database using Update option.



Monday, May 12, 2014

Exchange 2013 Move-Databasepath fails with Error: WMI exception occurred on server

Problem:
Move-Databasepath command is not working and showing the following error after 5 min


Resolution:
  • Perform a Full Backup of the Server which in effect will purge the logs.  This can be performed by using Windows Server Backup or another product.
  • Enable Circular Logging, dismount/remount the database, then Re-enable Circular Logging.
  • Manually delete the log files.  Do not perform this procedure without checking first that all log files have been played into the database, doing so could result in loss of data. 
Verify:

Run> Get-MailboxDatabase “DatabaseName” | FL Name,*Path*



Or you can login to Exchange Admin Center





References:
http://clintboessen.blogspot.ae/2012/10/error-wmi-exception-occurred-on-server.html
http://clintboessen.blogspot.com.au/2010/09/flush-transaction-logs-in-exchange.html
http://tmitegypt.wordpress.com/2013/05/05/move-database-path-error-wmi-exception-occurred-on-server-quota-violation/
http://careexchange.in/how-to-move-database-path-and-log-folder-path-in-exchange-2013/

Thursday, May 1, 2014

When you select the Shared Mailbox and search there are no results.

Problem: 
When you select the Shared Mailbox and search, there are no results. but when u select individual folders within the shared mailbox it can search them but only individually. 

Resolution:
In outlook, click Tools and then Account Settings, press "change" - "more settings", go to the "Advanced" tab (where you configured the shared mailbox before" and uncheck the "Download shared folders" box, restart outlook.

Wednesday, April 30, 2014

Change the drive letter that holds Exchange 2013 Database

I was working on Exchange migration project and i was need to change the drive letter that holds one of our Exchange mailbox databases, the following steps i did to change the Exchange configuration to point to the new database file path as well as changing the disk letter and its name,

Note: i was not moving the Database from Disk to another new disk, i just wanted to change the drive letter as i had to configure a Database copy on another Exchange server Within DAG as the Exchange by default will use the same drive letter configured in the Active Database for locate the Database and log for the copy database.

Steps:
1- Dismount the Database using ECP or Powershell "Dismount-Database -Identity MyDatabase"
2- Change the drive letter using computer management
3- Reconfigure the Exchange database file path using the following Powershell CMD
"Move-DatabasePath -Identity DB03 -EdbFilePath “J:\Program Files\Microsoft\Exchange Server\V15\Mailbox\DB03\DB03.edb” –LogFolderPath “L:\Program Files\Microsoft\Exchange Server\V15\Mailbox\DB03” –ConfigurationOnly $true"



Note: In my case I have used "-ConfigurationOnly" switch as no need to make the exchange move the database from disk to another as it is the same drive
"The ConfigurationOnly switch specifies whether the configuration of the database changes without moving any files. A value of $true changes the configuration. A value of $false changes the configuration and moves the files. The default value is $false."

4- Mount the database again using ECP or Powershell "Mount-Database -Identity ExchangeServer.Domain.com\MyDatabase"



When you use the Move-DatabasePath cmdlet, consider the following:
  • This cmdlet fails if it's run while the database is being backed up.
  • If the specified database is mounted when this cmdlet is run, the database is automatically dismounted and then remounted, and is unavailable to users while it's dismounted.
  • This cmdlet normally can be run on the affected Mailbox server only. An exception is that this cmdlet can be run on an administrator's workstation when using theConfigurationOnly parameter with a value of $true
  • This cmdlet can't be run against replicated mailbox databases. To move the path of a replicated database, you must first remove all replicated copies, and then you can perform the move operation. After the move operation is complete, you can add copies of the mailbox database.

Monday, April 21, 2014

Getting all VM's IP addresses on Hyper-V Host

PowerShell CMD:

Get-VM | ?{$_.State -eq "Running"} |  Get-VMNetworkAdapter | Select VMName, IPAddresses

Wednesday, April 16, 2014

Exchange 2013 setup Error: The virtual directory ‘PowerShell’ already exists under ‘exchange hostname (FQDN)/Default Web Site’.

While am working in Exchange migration the customer decided to convert on of the archive servers to Mailbox server, so we uninstalled the Exchange from that machine in order to change the host name after we changed the host name and located the new LUN for this new mailbox server I faced the following errors while re-installing the Mailbox role on the same server:



Step 7 of 12: MailBox Role: Transport Service

Error:
The following error was generated when "$error.Clear();
          $vdirName = "PowerShell";
          $InternalPowerShellUrl="http://" + $RoleFqdnOrName + "/powershell";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -InternalUrl $InternalPowerShellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$false -RequireSSL:$false -WebSiteName "Default Web Site" -AppPoolId "MSExchangePowerShellFrontEndAppPool";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$true -RequireSSL:$true -WebSiteName "Exchange Back End" -Path ($RoleInstallPath + "ClientAccess\PowerShell-Proxy");
        " was run: "The virtual directory 'PowerShell' already exists under 'ExchangeServerFQDN/Default Web Site'.
Parameter name: VirtualDirectoryName".

And



Error:
The following error was generated when "$error.Clear();
          $vdirName = "PowerShell";
          $InternalPowerShellUrl="http://" + $RoleFqdnOrName + "/powershell";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -InternalUrl $InternalPowerShellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$false -RequireSSL:$false -WebSiteName "Default Web Site" -AppPoolId "MSExchangePowerShellFrontEndAppPool";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$true -RequireSSL:$true -WebSiteName "Exchange Back End" -Path ($RoleInstallPath + "ClientAccess\PowerShell-Proxy");
        " was run: "The AD configuration for virtual directory 'PowerShell' already exists in 'CN=PowerShell (Exchange Back End),CN=HTTP,CN=Protocols,CN=ExchangeServer,CN=Servers,CN=Exchange Administrative Group (),CN=Administrative Groups,CN=Domain,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain,DC=Root', please remove this AD configuration manually.
Parameter name: VirtualDirectoryName".

And

Error:
The following error was generated when "$error.Clear();
          $vdirName = "PowerShell";
          $InternalPowerShellUrl="http://" + $RoleFqdnOrName + "/powershell";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -InternalUrl $InternalPowerShellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$false -RequireSSL:$false -WebSiteName "Default Web Site" -AppPoolId "MSExchangePowerShellFrontEndAppPool";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$true -RequireSSL:$true -WebSiteName "Exchange Back End" -Path ($RoleInstallPath + "ClientAccess\PowerShell-Proxy");
        " was run: "The AD configuration for virtual directory 'PowerShell' already exists in 'CN=PowerShell (Default Web Site),CN=HTTP,CN=Protocols,CN=ExchangeServer,CN=Servers,CN=Exchange Admdinistrative Group (),CN=Administrative Groups,CN=domain,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Domain,DC=Root', please remove this AD configuration manually.
Parameter name: VirtualDirectoryName".

Error:
The following error was generated when "$error.Clear();
          $vdirName = "PowerShell";
          $InternalPowerShellUrl="http://" + $RoleFqdnOrName + "/powershell";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -InternalUrl $InternalPowerShellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$false -RequireSSL:$false -WebSiteName "Default Web Site" -AppPoolId "MSExchangePowerShellFrontEndAppPool";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$true -RequireSSL:$true -WebSiteName "Exchange Back End" -Path ($RoleInstallPath + "ClientAccess\PowerShell-Proxy");
        " was run: "The virtual directory 'PowerShell' already exists under 'ExchangeServerFQDN/Exchange Back End'.
Parameter name: VirtualDirectoryName".

And

Error:
The following error was generated when "$error.Clear();
          $vdirName = "PowerShell";
          $InternalPowerShellUrl="http://" + $RoleFqdnOrName + "/powershell";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -InternalUrl $InternalPowerShellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$false -RequireSSL:$false -WebSiteName "Default Web Site" -AppPoolId "MSExchangePowerShellFrontEndAppPool";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$true -RequireSSL:$true -WebSiteName "Exchange Back End" -Path ($RoleInstallPath + "ClientAccess\PowerShell-Proxy");
        " was run: "The virtual directory 'PowerShell' already exists under 'ExchangeServerFQDN/Default Web Site'.
Parameter name: VirtualDirectoryName".

Error:
The following error was generated when "$error.Clear();
          $vdirName = "PowerShell";
          $InternalPowerShellUrl="http://" + $RoleFqdnOrName + "/powershell";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -InternalUrl $InternalPowerShellUrl -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$false -RequireSSL:$false -WebSiteName "Default Web Site" -AppPoolId "MSExchangePowerShellFrontEndAppPool";
          new-PowerShellVirtualDirectory $vdirName -Role Mailbox -DomainController $RoleDomainController -BasicAuthentication:$false -WindowsAuthentication:$true -RequireSSL:$true -WebSiteName "Exchange Back End" -Path ($RoleInstallPath + "ClientAccess\PowerShell-Proxy");
        " was run: "The virtual directory 'PowerShell' already exists under 'ExchangeServerFQDN/Exchange Back End'.
Parameter name: VirtualDirectoryName".



Resolution:


1- Delete Powershell site under default web site and on this server



2- Open ADSIEDT from AD server. Click on Action and select “connection”.
Select “Configuration” from the drop down in the   “Connection  Settings” dialog






Navigate to:
CN=Configuration,DC=domain,DC=suffix
CN=Services
CN=Microsoft Exchange
CN=[your domain]
CN=Administrative Groups
CN=Exchange Administrative Groups
CN=Servers
CN=[your server]
CN=Protocols
CN=HTTP


Find the (in the right pane) CN=Powershell (Default Web Site), and (Exchange Back End) …  and delete it



Also, Delete the follwong registry keys if it exist:

Open the registry editor and navigate to
KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v14\MailboxRole
Find the “Action” key and delete it.




Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager
Locate the “PendingFileRenameOperations” key and delete it.