Avatar of pramod1
pramod1
Flag for United States of America asked on

exchange 2007

how will I find no. of users connecting through OWA or using owa, irrespective of mailbox features being enabled.
Exchange* OWA

Avatar of undefined
Last Comment
pramod1

8/22/2022 - Mon
Rajul Raj

With Log Parser Studio, you can create a custom query to check on the number of OWA users per minute from the IIS logs on your CAS. The query should look similar to the following:

Select cs-username AS UserID,QUANTIZE(TO_TIMESTAMP(date, time), 60) AS Minute, cs(User-Agent) AS Application from '[LOGFILEPATH]' WHERE cs-uri-stem LIKE '%OWA%'

Open in new window

pramod1

ASKER
I don't have log parser studio, any exchange shell command I can use
Scott C

Here is a script that looks like it will accomplish what you are looking for.

https://damn.technology/powershell-owa-user-list

Hopefully this will work for Exchange 2007...regardless, you need to start planning to migrate from Exch2007 to Exch2013 or Exch2016 as 2007 is almost at end of life.

BTW...

Here is where you d/l Log Parser Studio from.

https://gallery.technet.microsoft.com/office/Log-Parser-Studio-cd458765
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
pramod1

ASKER
$path = "C:\WINDOWS\system32\LogFiles\W3SVC1\ex*"

# Create new DataTable to hold log entries
$tblLog = New-Object System.Data.DataTable "Log"
$arrUsers = New-Object System.Collections.ArrayList($null)
$bFirstRun = $TRUE;

foreach ($file in Get-ChildItem $path)
{
      # Get the contents of the file, excluding the first three lines.
      $fileContents = Get-Content $file.FullName | where {$_ -notLike "#[D,S-V]*" }

      # Create DataTable columns. No handling for different columns in
      # each log file.
      if( $bFirstRun )
      {
            $columns = (($fileContents[0].TrimEnd()) -replace "#Fields: ", "" -replace "-","" -replace "\(","" -replace "\)","").Split(" ")
            $colCount = $columns.Length

            # Create a DataColumn from the column string and add to our DataTable.
            foreach ($column in $columns)
            {
                  $colNew = New-Object System.Data.DataColumn $column, ([string])
                  $tblLog.Columns.Add( $colNew )
            }
            $bFirstRun = $FALSE;
            Write-Host "Columns complete"
      }
      
      # Get the row contents from the file, filtering what I want to retrieve.
      $rows = $fileContents | where {$_ -like "*/owa/Default.aspx*"}

      # Loop through rows in the log file.
      foreach ($row in $rows)
      {
            if(!$row)
            {
                  continue
            }

            $rowContents = $row.Split(" ")
            $newRow = $tblLog.newrow()
            for($i=0;$i -lt $colCount; $i++)
            {
                  $columnName = $columns[$i]
                  $newRow.$columnName = $rowContents[$i]
            }
            $tblLog.Rows.Add( $newRow )
      }
      Write-Host $file.Name "Done"
}
$tblLog | foreach {  if(! $arrUsers.Contains( $_.csusername ) ) { $arrUsers.Add( $_.csusername ) } }
$arrUsers
pramod1

ASKER
I RAN ABOVE IN .PS1 FILE but don't know where it saved
pramod1

ASKER
attached screen capture
C--Users-ic1pxk-Desktop-Capture4.JPG
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Scott C

Read the blog at the end....it doesn't save the results to a file.

It says you will be presented with the output.
pramod1

ASKER
I just see the script file owa.ps1 where I saved on desktop
Scott C

Right....is it possible that there are no users using OWA at this time?
Your help has saved me hundreds of hours of internet surfing.
fblack61
pramod1

ASKER
so where the content will be saved in the ps1 file itself?

I need to collect info as to how many users use owa in a  day
Scott C

No, the output should be displayed in the screen you run the script from.

This script will only collect the names of users who are CURRENLY using OWA, not how many access it in a day.
pramod1

ASKER
so there is no other script which can show how many users connect through OWA in a day?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Scott C

Not that I know of.  For that you might be able to use Log Parser Studio to go through the IIS log files for that.

The script I found was for your original question the way it was worded.

If you want to know how many users connect through the day, that would be a different question than the one originally asked.

And my answer for that would be the same....use LPS to parse through the log files.

Writing a script for that is not something I can do at this time.

There may be a canned script in LPS that you can modify to get the information you are looking for.
ASKER CERTIFIED SOLUTION
Scott C

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Scott C

Installing LPS is a 2-step process.  Download the .zip file in the link above, expand it, then run the .exe.

You will prompted to install a .msi file.  Do that, then you will be able to run LPS successfully.
pramod1

ASKER
i initially installed on my pc rather than on CAS SERVER. WHEN I unzip i got this and when i installed as msi. file i get this (attached) so where should i customize the script
C--Users-ic1pxk-Desktop-Capture6.JPG
C--Users-ic1pxk-Desktop-Capture8.JPG
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
pramod1

ASKER
or should i just use this in ps.1 file

SELECT TOP 200 cs-username AS UserID,
       cs(User-Agent) AS Application,
       cs-uri-stem AS Vdir,
       c-ip AS CLIENT,
       cs-method,
       Count(*)
 FROM '[LOGFILEPATH]'
 WHERE cs-uri-stem LIKE '%OWA%'
 GROUP BY UserID, Application, Vdir, Client, cs-method
 ORDER BY COUNT(*) DESC
pramod1

ASKER
i see LPSV2LIBRARY.XML file should i take out everything just leave the one u mentioned and run
pramod1

ASKER
I ran this got belwo error
C--Users-ic1pxk-Desktop-Capture10.JPG
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
pramod1

ASKER
pramod1

ASKER
I am using on exchange 2007