The case of: disabled mailbox provisioning on exchange 2010

August 12th, 2011
1 comment

Last week i had a customer complain that he was unable to provision users on his exchange 2010 mailbox servers, it looked like someone/something had disabled provisioning via powershell, a small investigation showed the system center agent running “Troubleshoot-DatabaseSpace.ps1″ every 10 minutes.

The script disables mailbox provisioning if disk space falls under 16% free space, since the customer are using incredible large disks for his exchange setup, he wanted to handle this on his own.

How to disable completely

If you need to completely disable the monitors calling “Troubleshoot-DatabaseSpace.ps1″ you will need to disable the following:

KHI: The database copy is low on database volume space and continues to grow. The volume is under 25% free.
KHI: The database copy is low on database volume space and continues to grow. The volume has reached error levels under 16% free.
KHI: The database copy is low on database volume space and continues to grow. The volume has reached critical levels 8% free.
KHI: Failed to execute Troubleshoot-DatabaseSpace.ps1.

Troubleshoot-DatabaseSpace.ps1 is located in: Program Files\Microsoft\Exchange Server\V14\Scripts\Troubleshoot-DatabaseSpace.ps1

How to modify monitoring values

Another approach to solve this matter would be to modify the values parsed to the script.
Since Troubleshoot-DatapaseSpace.ps1 is a built-in exchange  script,values are not set in the opsmgr console as expected, but in a file called “StoreTSConstants.ps”.

This file contains a lot of the constants used in a lot of exchange powershell scripts, it is here we will find the values we are looking for.
Modifying these values wont change the alert text in the opsmgr console, but only trigger the alert later.
Setting these to “0″ would presumably disable the alerting completely.

# The percentage of disk space for the EDB file at which we should start quarantining users.
$PercentEdbFreeSpaceDefaultThreshold = 25
# The percentage of disk space for the logs at which we should start quarantining users.
$PercentLogFreeSpaceDefaultThreshold = 25
# The percentage of disk space for the EDB file at which we are at alert levels.
$PercentEdbFreeSpaceAlertThreshold = 16
# The percentage of disk space for the EDB file at which we are at critical levels.
$PercentEdbFreeSpaceCriticalThreshold = 8

StoreTSConstants is located in: Program Files\Microsoft\Exchange Server\V14\Scripts\StoreTSConstants.ps1

 

Moving manual installed agents to new management server

Today i had a scenario where i needed to move 25 agents from one gateway to another(decommissioning the Domain controller due to hardware issues).
As i use manual installed agents, the “change primary managementserver” option was greyed out.

Following the guide on Kevin holmans blog i managed to set all my agents to “Remotely Manageable”, enabling this option

The SQL statement, as written on Kevins blog:

Enable Remotely Manageable

UPDATE MT_HealthService
SET IsManuallyInstalled=0
WHERE IsManuallyInstalled=1

Given that i had to move 25 agents i decided to use powershell to move my agents:

Move Agents

$primaryMS = Get-ManagementServer | where {$_.Name –eq 'Newgateway.fqdn'}
$agent = Get-Agent | where {$_.PrimaryManagementServerName -eq 'Oldgateway.fqdn'}
Set-ManagementServer -AgentManagedComputer: $agent -PrimaryManagementServer: $primaryMS

To verify i ran this:
This powershell script shows you every agent communicating with the new gateway, as the configuration updates you should see your agents getting listed.

Verify Agents

$Agents = Get-Agent | where {$_.PrimaryManagementServerName -eq 'Newgateway.fqdn'}
$Agents | sort | foreach {
       Write-Host "";
       "Agent    :: " + $_.Name;
       "--Primary MS  :: " + ($_.GetPrimaryManagementServer()).ComputerName;
       $failoverServers = $_.getFailoverManagementServers();
       foreach ($managementServer in $failoverServers) {
              "--Failover MS :: " + ($managementServer.ComputerName);
       }
}
Write-Host "";

After this i can delete the old gateway, and shut down the server.

Categories: Agent, Powershell, SQL Tags:

Failed to perform Web Site discovery

Symptom:

Failed to perform Web Site discovery (Event Description: Error reading properties of the Website ’xxxxxx’. Skipping Discovery of website. This operation will be retried. Error: 0×80070032 )

Cause:

Website running on IIS7.0 with application pool running .Net 4.0 and the configuration section ‘system.web.extensions’ cannot be read because it is missing a section declaration.
Because of this the system.web.extensions for Ajax element fails to process the config file.

Resolution:

To solve this problem you will need to add the following undersection in the web.config file:

1
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,  System.Web.Extensions, Version=4.0.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35" requirepermission="false" allowdefinition="MachineToApplication"></section><section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection,  System.Web.Extensions, Version=4.0.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35" requirepermission="false" allowdefinition="Everywhere"></section><section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection,  System.Web.Extensions, Version=4.0.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35" requirepermission="false" allowdefinition="MachineToApplication"></section><section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection,  System.Web.Extensions, Version=4.0.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35" requirepermission="false" allowdefinition="MachineToApplication"></section><section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection,  System.Web.Extensions, Version=4.0.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35" requirepermission="false" allowdefinition="MachineToApplication"></section>

Once this above is done, run the AppCmd:
C:\Windows\System32\inetsrv\appcmd list config ” Web site name xxxx”

If it fails with error below:

ERROR ( message:Configuration error Filename: \\?\C:\inetpub\wwwroot\web.config Line Number: 200 Description: Unrecognized element ‘providerOption’. )

The above error is observed for below section in web.config:

1
 

Removing lines below helps the validation to succeed.

1
 

Run the command again:
C:\Windows\System32\inetsrv>appcmd list config ” Web site name xxxx”
And it should work without errors. And next web site discovery should be complete without errors.

Introduction

October 14th, 2009
No comments

Welcome to Scom in DK

This blog is intended to contain the system center projects i am currently working on, mainly from an ISP and hosting partner perspective.

I will post powershell script, Managementpack, as well as support scenarios and so on.

Stay tuned for updates.

Categories: Blogs Tags: