Link to home
Start Free TrialLog in
Avatar of NetManaged
NetManagedFlag for United States of America

asked on

Get Active Conferences in Skype for Business

Attempting to find current active conferences in Skype for Business Server 2015.
I get this result:

Convert-UTCtoLocal : Cannot bind argument to parameter 'UTCTime' because it is
an empty string.
At C:\Support\SfB PowerShell Scripts\Get-csActiveConferences.ps1:32 char:53
+   $Result."Join Time" = Convert-UTCtoLocal -UTCTime $Result."Join Time"
+                                                     ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Convert-UTCtoLocal], Parameter
   BindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAl
   lowed,Convert-UTCtoLocal

When I run this PowerShell command .Get-csActiveConferences.ps1
CODE:
Param (
  $PoolFQDN = (Read-Host -Prompt "Please enter the Pool FQDN")
)

#### Script Information
#
# Originally written by Richard Brynteson
# http://masteringlync.com
####

# Convert UTC to Local timezone
function Convert-UTCtoLocal {
  param(
    [parameter(Mandatory=$true)]
    [String] $UTCTime
  )
 
  $strCurrentTimeZone = (Get-WmiObject win32_timezone).StandardName
  $TZ = [System.TimeZoneInfo]::FindSystemTimeZoneById($strCurrentTimeZone)
  $LocalTime = [System.TimeZoneInfo]::ConvertTimeFromUtc($UTCTime, $TZ)
 
  Return $LocalTime
}

#Loop Through Front-End Pool
Foreach ($Computer in (Get-CsPool -Identity $PoolFQDN).Computers) {
 
  $Result = Invoke-SQLCmd -ServerInstance "$Computer\rtclocal" -Database rtcdyn -Query "SELECT ActiveConference.ConfId AS 'Conference ID', ActiveConference.Locked, Participant.UserAtHost AS  'Participant', Participant.JoinTime AS 'Join Time', Participant.EnterpriseId, ActiveConference.IsLargeMeeting AS 'Large Meeting' FROM   ActiveConference INNER JOIN Participant ON ActiveConference.ConfId = Participant.ConfId;"
 
  $Result | Add-Member -NotePropertyName 'Frontend' -NotePropertyValue $Computer
 
  $Result."Join Time" = Convert-UTCtoLocal -UTCTime $Result."Join Time"
 
  $Results += $Result
}

#$Results | ft 'Participant', 'Join Time', 'Large Meeting', 'Frontend' -GroupBy 'Conference ID'

$Results

How to correct?
Avatar of Raheman M. Abdul
Raheman M. Abdul
Flag of United Kingdom of Great Britain and Northern Ireland image

do you see output at all in "Join Time" column?
 $Result  should show the value in "Join Time" column
the error shows there is no value in the "Join Time" Column.

try the below code:
Param (
  $PoolFQDN = (Read-Host -Prompt "Please enter the Pool FQDN")
)

#### Script Information
#
# Originally written by Richard Brynteson
# http://masteringlync.com
####

# Convert UTC to Local timezone
function Convert-UTCtoLocal {
  param(
    [parameter(Mandatory=$true)]
    [String] $UTCTime
  )
 
  $strCurrentTimeZone = (Get-WmiObject win32_timezone).StandardName
  $TZ = [System.TimeZoneInfo]::FindSystemTimeZoneById($strCurrentTimeZone)
  $LocalTime = [System.TimeZoneInfo]::ConvertTimeFromUtc($UTCTime, $TZ)
 
  Return $LocalTime
}
$Results = @()

#Loop Through Front-End Pool
Foreach ($Computer in (Get-CsPool -Identity $PoolFQDN).Computers) {
 
  $Result = Invoke-SQLCmd -ServerInstance "$Computer\rtclocal" -Database rtcdyn -Query "SELECT ActiveConference.ConfId AS 'Conference ID', ActiveConference.Locked, Participant.UserAtHost AS  'Participant', Participant.JoinTime AS 'Join Time', Participant.EnterpriseId, ActiveConference.IsLargeMeeting AS 'Large Meeting' FROM   ActiveConference INNER JOIN Participant ON ActiveConference.ConfId = Participant.ConfId;"
 
  $Result | Add-Member -NotePropertyName 'Frontend' -NotePropertyValue $Computer
 
  $Result

  $Result."Join Time" = Convert-UTCtoLocal -UTCTime $($Result."Join Time")
 
  $Results += $Result
}

#$Results | ft 'Participant', 'Join Time', 'Large Meeting', 'Frontend' -GroupBy 'Conference ID'

#$Results

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.