#powershell #skype4b Scheduled Task Does Not Work

You tested your #skype4b script from the PowerShell command line and are satisfied that everything works as expected. Next, you create a regular Windows scheduled task to run the script at a specific time of a day. However, you are surprised that no results are returned from simple cmdlets like Get-CsUser. You even wrap similar code in Invoke-Command and purposely target remote hosts with -ComputerName with no success.

Ultimately… Continue reading “#powershell #skype4b Scheduled Task Does Not Work”

#powershell Start-Job -ArgumentList Bug?

Irrespective of the position of -ArgumentList, including the intentional placement at the end of the statement per documentation for Start-Job, a string array will be treated as a single string object when passed to this cmdlet using the aforementioned parameter:

$arr = "a","b","c","d"
Start-Job -ScriptBlock {
param($a) $items = @(); $a | % { $items += $_; }; $items; } -ArgumentList $arr
$result = Receive-Job -id 2
$result
#a
$result.GetType()
#String
$result.count
#1

Continue reading “#powershell Start-Job -ArgumentList Bug?”

#skype4b #powershell *-CsDatabase Common Error Messages (and Fix)

Even with the right administrative account and permissions, and proper network as well as firewall (port) settings provisioned, a number of common error messages when working with *-CsDatabase cmdlets in Skype for Business Server prove to be rather challenging to decipher and resolve:

PS C:\> Install-CsDatabase -SqlServerFqdn sql01.leedesmond.com -SqlInstanceName sql01inst01 -Update -ConfiguredDatabases
Install-CsDatabase : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Install-CsDatabase -SqlServerFqdn sql01.leedesmond.com -SqlInstanceName sql01inst01 -Update -ConfiguredDatabases
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Install-CsDatabase], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Rtc.Management.Deployment.InstallDatabaseCmdlet

Continue reading “#skype4b #powershell *-CsDatabase Common Error Messages (and Fix)”

#skype4b/lync Hide Share/Presentation Meeting Window (Keyboard Shortcut)

In a conference call using Skype for Business 2016/2015 desktop client, an end-user is only allowed to toggle between Speaker and Gallery view using the left most icon on the top right hand corner of the meeting window. Until someone shares something or makes a PowerPoint presentation, you may have to stare at the (typically low-resolution) overblown photograph of the active speaker or a row of meeting participants’ pictures.

To go back to classic “telephone” audio voice calls with no visual cues of the person speaking whatsoever, you can hit Ctrl+Shift+P on the keyboard to move into Compact View for the Sfb desktop client. This functions apparently only if the Participants window is active otherwise the Gallery view will be shown.

REFERENCE
Keyboard shortcuts for Skype for Business

#skype4B/Lync #powershell Script: Compare User Policy (Update v1.10)

This revised version of Compare-Skype4BUserPolicy adds the option to include items that hold the same values. It is one of the many PowerShell functions/utilities in my personal script toolbox repository designed to help simplify the management and administration of just about any Lync / Skype for Business Server environments.

Have fun!

################################################################################
# Copyright (c) 201x-2017 leedesmond.com
# All Rights Reserved. Use at your own risk and responsibility.
# Compare-Skype4BUserPolicy.ps1
# Version 1.10
# Continue reading "#skype4B/Lync #powershell Script: Compare User Policy (Update v1.10)"

#powershell One-liner Code: Event Logs Overview

One liner #powershell code to list the frequency of most recent events generated for the specified EventViewer log file type.

( can you spot an “error”? )
Get-EventLog -ComputerName (hostname) -LogName system |
Group-Object EntryType |
% `
-Begin { "-begin '$($_.name)'" } `
-Process {
"-process '$($_.name)'";
$_.group | group EventId |
sort count -desc |
select count, name,
@{l='TimeGenerated';e={$_.group[0].TimeGenerated}},
@{l='Message';e={$_.group[0].Message}}} |
ft -au

#skype4b #powershell Event ID and Provider “Crash” (Source)

Certain third party software programs may use the same Event ID to write entries in the Application event log. An example is Event ID 10 used by the source “Verba System Monitor” (now part of Actiance) which crashes with information logged by Windows system providers like WMI.

Hence, when gathering logs with Get-EventLog and Get-WinEvent, remember to check not just the Event ID but also that of the Provider (Source).

Actiance Vantage and/or Verba are software applications typically deployed in a Skype for Business environment where ethical firewalls are erected for the purpose of segregating communications between (internal) business units.

#skype4b #powershell Compare (Any) Lync/Skype Policy

Compare-SfbAnyPolicy is one of the many PowerShell functions/utilities in my personal script toolbox repository designed to help simplify the management and administration of just about any Lync / Skype for Business Server environments.

Enjoy!

################################################################################
# Copyright (c) 201x-2017 leedesmond.com
# All Rights Reserved. Use at your own risk and responsibility.
# Compare-SfbAnyPolicy.ps1
# Version 1.00
# Continue reading “#skype4b #powershell Compare (Any) Lync/Skype Policy”

#powerShell Inhibit Output Echo from ArrayList Method

For optimal performance, creation of an empty array using
$a = New-Object System.Collections.ArrayList

is, for instance, preferred over
$a = @()

However, putting a single element into the array with the former’s Add() method will auto output the index of the just inserted item. If left unchecked, this can become part of the output in a PowerShell function call which may not be desirable.

To resolve this, simply pipe the call to Out-Null like
$a.Add((Get-Date)) | Out-Null

or prefix with [void] to suppress the echo:
[void]$a.Add((Get-Date))