Exchange Meeting Room Statistics

This script uses Exchange Web Services to connect to one or more meeting rooms and gather statistics regarding their usage between to specific dates.

 
 
 
 
 
(0)
1,711 times
Add to favorites
Exchange
12/15/2017
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Exchange 2010 SP3 Error
    1 Posts | Last post May 08, 2018
    • Hello Nuno,
      
      I've tried to run your script on my work space but it gives me an error:
      
      "Unable to connect ***@***.com. Please check permissions: Exception calling
      "Bind" with "2" argument(s): "Exchange Server doesn't support the requested version.". Skipping ***@***.com."
      
      
      We use Exchange 2010 SP3, so I've already changed your code for it. We also don't use Exchange Online. 
      What do you think could be the source of this error? 
      Thanks!
  • Error in Office 365.
    1 Posts | Last post May 04, 2018
    • Hello I am trying to run this script for all the rooms we have in office 365 and am getting the following error.  
      
      VERBOSE: Binding to the  xyz_room@abc.com. Calendar folder.
      VERBOSE: Unable to connect to  xyz_room@abc.com. Please check permissions: Exception calling "Bind" with "2" argument(s): "The Id property must be set.". Skipping 
       xyz_room@abc.com.
  • Exchange 2016 CU8
    2 Posts | Last post April 19, 2018
    • Hi,
      Is the script working on Windows Server 2016 (Version 1607) and Exchange 2016 CU 8?
      The script worked on earlier Exchange 2016 versions but now I get the following message on CU 8:
      
      VERBOSE: Loading EWS Managed API
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      VERBOSE: Binding to the xyz_room@abc.com Calendar folder.
      VERBOSE: Unable to connect to xyz_room@abc.com. Please check permissions: Exception calling "Bind" with "2" argument(s): "Exchange Server doesn't support t
      he requested version.". Skipping xyz_room@abc.com.
      
      
    • Hi,
      
      I haven't tested it on that particular CU. I will update my lab and test soon.
      
      Regards,
      Nuno
  • Unable to Run against Office365
    4 Posts | Last post March 18, 2018
    • I'm unable to run this against Office365. Can you please help?
      
      PS C:\Scripts> .\Get-MeetingRoomStats_EWS.ps1 -RoomListSMTP "US.CA.Plstn.RM.B1.141.Cap.14.Video@clorox.com" -From "10/01/2017" -To "11/01/2017" -Verbose
      VERBOSE: Loading EWS Managed API
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      VERBOSE: Binding to the US.CA.Plstn.RM.B1.141.Cap.14.Video@clorox.com Calendar folder.
      VERBOSE: Unable to retrieve data from US.CA.Plstn.RM.B1.141.Cap.14.Video@clorox.com calendar. Please check permissions:
       Cannot convert argument "0", with value: "Microsoft.Exchange.WebServices.Data.Appointment 
      Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment 
      Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment 
      
      Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment 
      Microsoft.Exchange.WebServices.Data.Appointment", for "LoadPropertiesForItems" to type 
      "System.Collections.Generic.IEnumerable`1[Microsoft.Exchange.WebServices.Data.Item]": "Cannot convert the 
      "Microsoft.Exchange.WebServices.Data.FindItemsResults`1[Microsoft.Exchange.WebServices.Data.Appointment]" value of type
       "Microsoft.Exchange.WebServices.Data.FindItemsResults`1[[Microsoft.Exchange.WebServices.Data.Appointment, 
      Microsoft.Exchange.WebServices, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]" to type 
      "System.Collections.Generic.IEnumerable`1[Microsoft.Exchange.WebServices.Data.Item]".". Skipping 
    • I fought with this for half a day and had to do the following to get this to work for me in an O365 environment:
      
      1. Modified the Connect-Exchange function for 0365 (see many examples here in this thread)
      
          $service.Credentials = New-Object Microsoft.Exchange.WebServices.Data.WebCredentials('email@dot.com', 'the_password')
      	$service.Url = new-object Uri("https://outlook.office365.com/EWS/Exchange.asmx");
          #$service.AutodiscoverUrl($Mailbox, {$true});
      
      2.  On or about line 128-130 ===  This is the line choking and bitching about unable to convert type from x to z -- I simply rem'd it out and the code still mostly worked (I do not get attendee data back, no big deal)
      
      #If ($fiItems.Items.Count -gt 0) {[Void] $service.LoadPropertiesForItems($fiItems, $psPropset)}
      
      3. On or about line 180, look for RoomName being assigned -- rem it out and replace it with this:
      RoomName		= $room.DisplayName
      
      		
      
      
    • @DukePresser or @Hariharan GB or @Nuno Mota, have any of you figured out how to fix this issue?  I have the same issue.  Remming out one line like Duke suggested does allow the script to run successfully, but I really do need the attendee data.
    • Hi guys,
      
      Are you using the latest version of the script that supports Exchange Online? Do you still get the same error with this verison?
      
      Regards,
      Nuno
  • While i am running the script i am getting the Csv file created as blank.
    2 Posts | Last post March 18, 2018
    • I am trying to run this in exchange 2010 environment
    • Is it not working? What error do you get?
  • Error running on Exchange 2010
    2 Posts | Last post March 18, 2018
    • Nuno,
      I'm running this from an account that has full permission on all mailboxes and I have corrected the line to specify Exchange2010_SP3.  I also tried changing it to Exchange2010_SP2 as one of the other posters suggested.  I'm getting this below.
      Thanks
      
      [PS] C:\temp>.\Get-MeetingRoomStats.ps1 -RoomListSMTP "vpodalb@PROGRESSRAIL.com, albtelepresence@PROGRESSRAIL.com" -From
       "02/20/2017" -To "02/19/2018" -Verbose
      VERBOSE: Loading EWS Managed API
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      VERBOSE: Binding to the vpodalb@PROGRESSRAIL.com Calendar folder.
      VERBOSE: Unable to connect to vpodalb@PROGRESSRAIL.com. Please check permissions: Exception calling "Bind" with "2"
      argument(s): "The specified folder could not be found in the store.". Skipping vpodalb@PROGRESSRAIL.com.
      VERBOSE: Binding to the albtelepresence@PROGRESSRAIL.com Calendar folder.
      VERBOSE: Unable to connect to albtelepresence@PROGRESSRAIL.com. Please check permissions: Exception calling "Bind" with
       "2" argument(s): "The specified folder could not be found in the store.". Skipping albtelepresence@PROGRESSRAIL.com.
    • Hi Samantha,
      
      I am assuming the SMTP addresses are correct and are the primary SMTP addresses?
      
      Regards,
      Nuno
  • Exchange 2010 SP3
    8 Posts | Last post November 13, 2017
    • Hi Nuno,
      
      Great script, just what i'm needing for a requested report. Question any idea why it's failing for me in Exchange 2010 SP3?? i have Reviewer & Full access assigned on the MeetingRoom
      
      VERBOSE: Loading EWS Managed API
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      VERBOSE: Binding to the meetingroom@emailaddress.com Calendar folder.
      VERBOSE: Unable to connect to meetingroom@emailaddress.com. Please check permissions: Exception calling "Bind" with "2"
      argument(s): "Exchange Server doesn't support the requested version.". Skipping meetingroom@emailaddress.com.
    • Hi Jabarca,
      
      Excellent, glad the script helps!    :)
      Did you update the following line to Exchange2010_SP3?
      
      $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013_SP1)
      
      Regards,
      Nuno
    • Hi,
      
      yes i did. this is like it looks like
      
      $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP3)
      
      tried another Meeting Room without assigning permissions and the issue is the same, so it's not related to permissions.
      
      Any help would be great
      
      cheers,
    • Hey Jabarca, I have run the string and when you put Exchange2010_SP3 it will use the Exchange2013 setting.
      
      Change it to Exchange2010_SP2 and it will work fine.  I have written other scripts with the same issue...
      
      Craig.
    • Hey Craig,
      
      thanks for the input however it did not work for me. take a look at below details after changing the string...
      
      any advise would be very welcome!
      
      VERBOSE: Loading EWS Managed API
      VERBOSE: Loading module from path 'C:\Program Files\Microsoft\Exchange\Web
      Services\2.2\Microsoft.Exchange.WebServices.dll'.
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      VERBOSE: Binding to the meetingroom@emailaddress.com Calendar folder.
      VERBOSE: Unable to retrieve data from meetingroom@emailaddress.com calendar. Please check permissions: Cannot convert
      argument "0", with value: "Microsoft.Exchange.WebServices.Data.Appointment
      Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment
      Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment
      Microsoft.Exchange.WebServices.Data.Appointment", for "LoadPropertiesForItems" to type
      "System.Collections.Generic.IEnumerable`1[Microsoft.Exchange.WebServices.Data.Item]": "Cannot convert the
      "Microsoft.Exchange.WebServices.Data.FindItemsResults`1[Microsoft.Exchange.WebServices.Data.Appointment]" value of type
       "Microsoft.Exchange.WebServices.Data.FindItemsResults`1[[Microsoft.Exchange.WebServices.Data.Appointment,
      Microsoft.Exchange.WebServices, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]" to type
      "System.Collections.Generic.IEnumerable`1[Microsoft.Exchange.WebServices.Data.Item]".". Skipping
      meetingroom@emailaddress.com.
    • Does it work for any meeting room, or does it fail for all of them?
    • Hi all.
      Running into same issue.
      Wondering if anyone had better luck yet.
      "Exception calling "Bind" with "2" argument(s): "Exchange Server doesn't support the requested version"
    • I am also getting errors running this script on Exchange 2010.  
      
      .\Get-MeetingRoomStats_EWS.ps1 -RoomListSMTP "room@email.com" -From "01/01/2017" -To "01/13/2017" -Verose
      VERBOSE: Loading EWS Managed API
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      VERBOSE: Binding to the room@email.com Calendar folder.
      VERBOSE: Unable to retrieve data from room@email.com calendar. Please check permissions: Cannot convert argument
       "0", with value: "Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment
      Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment
      Microsoft.Exchange.WebServices.Data.Appointment Microsoft.Exchange.WebServices.Data.Appointment
      Microsoft.Exchange.WebServices.Data.Appointment", for "LoadPropertiesForItems" to type
      "System.Collections.Generic.IEnumerable`1[Microsoft.Exchange.WebServices.Data.Item]": "Cannot convert the
      "Microsoft.Exchange.WebServices.Data.FindItemsResults`1[Microsoft.Exchange.WebServices.Data.Appointment]" value of type
       "Microsoft.Exchange.WebServices.Data.FindItemsResults`1[[Microsoft.Exchange.WebServices.Data.Appointment,
      Microsoft.Exchange.WebServices, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]" to type
      "System.Collections.Generic.IEnumerable`1[Microsoft.Exchange.WebServices.Data.Item]".". Skipping room@email.com.
  • Script still failing
    1 Posts | Last post October 26, 2017
    • Have amended all the bits for Online Tenancy ($service etc.) and still getting following error for ALL meeting rooms (have Full Access Permissions:
      
      Please check permissions: Exception calling "Bind" with "2" argument(s): "The request failed. The underlying connection was closed: An unexpected error occurred on a send.". Skipping
      
      Any help much appreciated 
      
      MTIA & Best Rgds
  • Does this work with Exchange Online?
    6 Posts | Last post August 28, 2017
    • I run the script as directed, but it returns nothing, not even an error.
    • Hi Tom,
      
      Did you use the -Verbose switch when running the script?
      
      Regards,
      Nuno
    • I don't think it works with Exchange Online, at least not with the way our autodiscover is configured.
      
      VERBOSE: Loading EWS Managed API
      VERBOSE: Loading module from path 'C:\Program Files\Microsoft\Exchange\Web
      Services\2.2\Microsoft.Exchange.WebServices.dll'.
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      Exception calling "AutodiscoverUrl" with "1" argument(s): "Autodiscover blocked a potentially insecure redirection to
      https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml. To allow Autodiscover to follow the redirection, use
      the AutodiscoverUrl(string, AutodiscoverRedirectionUrlValidationCallback) overload."
      At C:\Scripts\Get-MeetingRoomStats_EWS.ps1:86 char:2
      +     $service.AutodiscoverUrl($Mailbox)
      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : AutodiscoverLocalException
      
      VERBOSE: Error conneting to Exchange Web Services (no AutoDiscover URL). Exiting Script.
    • Hi Tom,
      
      Exchange Online works differently. Instead of using:
      $service.AutodiscoverUrl($Mailbox)
      
      Try manually specifying the URL for Exchange Online, such as:
      $service.Url = [System.URI] "https://autodiscover.outlook.com/ews/exchange.asmx"
      
      Please note that I haven't tested this script with Exchange Online!
      
      Regards,
      Nuno
    • Hi Nuno.
      
      Could you check this script with Exchange online and please let us know the exact script as we have tried all given suggestion and it still failed with as below.
      ===================
      PS D:\> .\Get-MeetingRoomStats_EWS.ps1 -Verbose
      
      cmdlet Get-MeetingRoomStats_EWS.ps1 at command pipeline position 1
      Supply values for the following parameters:
      RoomListSMTP: test@example.com
      VERBOSE: Creating Exchange Service Object using AutoDiscover
      VERBOSE: Binding to the test@example.com Calendar folder.
      VERBOSE: Unable to connect to test@example.com. Please check permissions: Exception calling "Bind" with "2"argument(s): "The specified folder could not be found in the store.". Skipping test@example.com
      
    • I am trying online and I set 
      $service.Url = [System.URI] "https://autodiscover.outlook.com/ews/exchange.asmx"
      However unable to bind
      VERBOSE: Binding to the meetingroom6@domain.com Calendar folder.
      VERBOSE: Unable to connect to meetingroom6@domain.com. Please check permissions: Exception calling "Bind" with "2" argument(s): "The request failed. Unable to connect to the remote server"
      . Skipping meetingroom6@domain.com.
      
      I have full permissions on the mailbox. Any Ideas?
  • Here is what I changed to make it work with Exchange online.
    1 Posts | Last post July 17, 2017
    • 1. Modified the Connect-Exchange function (make sure you update the admin account and password) : 
      
      # Create Exchange Service Object and set Exchange version
      	Write-Verbose "Creating Exchange Service Object using AutoDiscover"
      	$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013_SP1)
          $service.Credentials = New-Object Microsoft.Exchange.WebServices.Data.WebCredentials -ArgumentList admin@domain.com, “Password!”
      	$service.AutodiscoverUrl('admin@domain.com', {$true})
      
      2. Modified the RoomName query (Get-ADuser is expected to fail in cloud): 
      
      RoomName		= (Get-Mailbox $room -ErrorAction SilentlyContinue).DisplayName
      
      
      Hope this help and Thank you Nuno for the great script! 
1 - 10 of 15 Items