NetManaged
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-csActiveConfer ences.ps1: 32 char:53
+ $Result."Join Time" = Convert-UTCtoLocal -UTCTime $Result."Join Time"
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Convert-UTCtoLocal], Parameter
BindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidatio nErrorEmpt yStringNot Al
lowed,Convert-UTCtoLocal
When I run this PowerShell command .Get-csActiveConferences.p s1
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).StandardNa me
$TZ = [System.TimeZoneInfo]::Fin dSystemTim eZoneById( $strCurren tTimeZone)
$LocalTime = [System.TimeZoneInfo]::Con vertTimeFr omUtc($UTC Time, $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.IsLargeMe eting 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?
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-csActiveConfer
+ $Result."Join Time" = Convert-UTCtoLocal -UTCTime $Result."Join Time"
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Convert-UTCtoLocal], Parameter
BindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidatio
lowed,Convert-UTCtoLocal
When I run this PowerShell command .Get-csActiveConferences.p
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).StandardNa
$TZ = [System.TimeZoneInfo]::Fin
$LocalTime = [System.TimeZoneInfo]::Con
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.IsLargeMe
$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?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers 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.
$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:
Open in new window