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.



Monday, April 14, 2014

Lync Server 2013 Front End Service Won’t Start

Lync Server 2013 Front End Service Won’t Start and the following warning appear in the event viewer

Server startup is being delayed because fabric pool manager has not finished initial placement of users.
Currently waiting for routing group: {8EC325CB-B512-587D-9D03-E940E7CC1490}.
Number of groups potentially not yet placed: 1.
Total number of groups: 1.
Cause: This is normal during cold-start of a Pool and during server startup.
If you continue to see this message many times, it indicates that insufficient number of Front-Ends are available in the Pool.
Resolution:
During a cold-start of a large Pool it can take upto an hour for the placement process to finish as it needs to populate all the Front-End databases with data from the Backup Store. If the Pool is running and the Front-End is just started, this is normal for some time. If this repeats for a long time, ensure that all the Front-Ends configured for this Pool are up and running. If multiple Front-Ends have been recently decommissioned, run Reset-CsPoolRegistrarState -ResetType QuorumLossRecovery to enable the Pool to recover from Quorum Loss and make progress

Resolution:

Run the following CMD with ResetType FullReset intead of QuorumLossRecovery

Reset-CsPoolRegistrarState -PoolFqdn ” frondendpool name” -ResetType FullReset

Reference:
http://www.concurrency.com/blog/lync-server-2013-preview-front-end-service-wont-start/
http://seneej.com/tag/lync-frond-end-service-not-starting/