Posts Tagged ‘microsoft’

OCS 2007 R2 Additional Custom Reports for Archiving CDR Reporter Tool

Monday, October 25th, 2010

Found this post [blogs.technet.com] for configuring additional custom reports / SQL queries using the OCS Archiving CDR Reporter Tool (look for the heading ‘Some useful SQL queries’). However, it may be specific to OCS 2007 (not R2). The format of the queries in the XML file require some modification to work in R2 (for me anyway). When the queries are added to the Archiving CDR Reporter Tool’s config file (ArchivingCdrReporter.xml located in the ..\ResKit\ArchivingCdrReporter folder), they gave a “No database alias” error as follows when the tool was next run:

First thing that needs to happen is the queries need to have a database alias specified since their are two logging databases, CDR and Archiving and this tells the tool which database the query applies to. At the end of each query, between the </Value> and </Query> tags, need to add:

<Description>Archiving</Description>

These queries use the LcsLog, i.e. Archiving database. After that was done for each query, you may then got a “NullReferenceException” error:

To fix that, a tag needs to be added between the </Value> and <Database> tags for each query containing CDATA information such as:

<Description>
<![CDATA[ Query Description :   This query returns ... ]]>
</Description>

Once that is done, the tool should open and you should see the new queries available under the ‘More reports’ section in the tree.

Also, you can edit the queries that specify a User URI to make the address a variable so that it can be modified at runtime rather than in the XML file. For example: the “All IMs Sent by User” query can look like this in the XML file (note use of User1Filter(Users.UserId) at the end of the query):

<Query>
      <Name>All IMs Sent by User</Name>
      <Value>Select * from Messages, Users where Users.UserId = Messages.FromId and User1Filter(Users.UserId)</Value>
      <Description>
<![CDATA[
Query Description :
  The query returns ...
]]>
      </Description>
      <Database>Archiving</Database>
    </Query>

That will allow you to enter a value in the tool’s ‘User1 (SIP URI)’ field, much more convenient than setting a value in the XML file and re-running the tool each time.

Popularity: 51% [?]

Online OCS 2007 Custom Presence Tool

Friday, September 3rd, 2010

Inspired by the downloadable tool from here [www.confusedamused.com], I put together an online tool. It will basically generate the XML and .reg file necessary to create custom presence for OCS 2007 Communicator clients. You can then copy and paste the content into the files you will actually use. I would recommend the Custom State URL value in most environments would probably be better set using Group Policy anyway, but the .reg file is handy to understand how it all works.

Online OCS Custom Presence Tool

Popularity: 18% [?]

How to find out the SIP URIs of users connected on one particular OCS Front End server – Ram Ojha's Blog – Site Home – TechNet Blogs

Friday, September 3rd, 2010

How to find out the SIP URIs of users connected on one particular OCS Front End server – Ram Ojha’s Blog – Site Home – TechNet Blogs.

To stop the query returning duplicates, just change it to ‘select distinct a.UserAtHost …’

Also, can extend the query slightly to provide a bit more info such as:

Declare @FrontEndServerID int
Set @FrontEndServerID=2

Select Fqdn "FE-Server-Name" from rtcdyn.dbo.FrontEnd where FrontEndId=@FrontEndServerID

Select count(distinct a.UserAtHost) "Active-Users-Count" from rtc.dbo.Resource a,
rtcdyn.dbo.DeliveryContext b where a.ResourceId=b.SubscriberId and b.FrontEndId=@FrontEndServerID

Select distinct a.UserAtHost "Active-Users" from rtc.dbo.Resource a,
rtcdyn.dbo.DeliveryContext b where a.ResourceId=b.SubscriberId and b.FrontEndId=@FrontEndServerID order by a.UserAtHost asc

Popularity: 8% [?]

Exchange 2007 Mailbox Quota Notification

Thursday, August 12th, 2010

Powershell script to check mailboxes that are at or close to quota and send the mailbox an email to advise:

$smtpserver = ""
$replyemailadd = ""
$mailboxserver = ""
$users = Get-MailBoxStatistics -Server $mailboxserver | where {"IssueWarning","ProhibitSend","MailboxDisabled" -contains $_.StorageLimitStatus} 

foreach ($objItem in $users)
{
$mailbox1 = $objItem.displayName + " item count: " + $objItem.itemcount + ", using " + $objItem.totalitemsize.value.ToMB() + "MB`n"
$mailbox2 = get-mailboxfolderstatistics $objItem.displayName | ft FolderPath, ItemsInFolder, @{Label="FolderSize(MB)";expression={$_.FolderSize.ToMB()} } -auto | Out-String
$mailbox3 = "Please contact ... if you have any questions regarding your mailbox quota.`n"
$messagesubject = "Quota Warning for " + $objItem.displayName + ", Size " + $objItem.totalitemsize.value.ToMB() + "MB used"
$mailboxfinal = $mailbox1 + $mailbox2 + $mailbox3

$temp = get-mailbox -identity $objItem.DisplayName

$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($replyemailadd, $temp.PrimarySmtpAddress,$messagesubject,$mailboxfinal)
}

Popularity: 5% [?]

Exchange 2007 Message Discovery and Removal Across Mailboxes

Wednesday, June 16th, 2010

Originally found this post on the Technet forums which links to this MS Exchange Team blog from a few years ago.

This cmdlet is great for discovering or removing messages by searching one or many mailboxes. Excellent for removing large messages sent to large distribution groups or virus/spam messages if identified early by the administrator, etc.

A couple of errors that might be returned by this cmdlet are:

[0] [ERROR] Error was found for (SourceMailboxEmailAddress) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error:
MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000, error code: -1056749164

[0] [ERROR] Error was found for (SourceMailboxEmailAddress) because: Error occurred in the step: Creating target folder in the target mailbox. An unknown error has occurred., error code: -2147221233

These are permissions issues. The account running the command needs to have full permissions to the source mailbox (first error code) and the destination mailbox (second error code). This is explained well here

That said, also take a look at this if you are sure that permissions are set correctly

Popularity: 6% [?]