Added Files

This commit is contained in:
DistractADD
2021-07-06 13:16:46 +10:00
parent f2475a3bdd
commit cfddd4fad2
393 changed files with 65842 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
# Enable all licenced users for Microsoft audio conferencing
#
# In addition to the SfB module this requires the MSOnline module so it can check who is licenced.
#
# Import MSOnline module and connect
Import-Module MSOnline
Connect-MsolService
# Load the Skype Online Connector module and connect
Import-Module SkypeOnlineConnector
$sfbSession = New-CsOnlineSession
Import-PSSession -Session $sfbSession
# This can be just one licence, or several, eg. MCOMEETADV (audio conferencing), ENTERPRISEPREMIUM (E5) and MEETING_ROOM all include audio conferencing.
# List of available SKUs can be obtained with (Get-MsolAccountSku).AccountSkuId
$audioConferencingLicences = @('MCOMEETADV','ENTERPRISEPREMIUM','MEETING_ROOM')
# Find everyone who has the audio conferencing licence(s) assigned
$users = @()
foreach ($audioConferencingLicence in $audioConferencingLicences) {
$users += (Get-MsolUser -All | Where-Object {($_.licenses).AccountSkuId -match $audioConferencingLicence}).UserPrincipalName
}
# Get the default service number from your tenant
$defaultServiceNumber = (Get-CsOnlineDialInConferencingBridge -Name 'Conference Bridge').DefaultServiceNumber
# Enable conferencing for everyone on that list who doesn't already have it enabled
foreach ($user in $users) {
$currentProvider = (Get-CsOnlineDialInConferencingUserInfo -Identity $user).Provider
if ($currentProvider -ne 'Microsoft') {
Enable-CsOnlineDialInConferencingUser -ServiceNumber $defaultServiceNumber -ReplaceProvider -SendEmail
}
}
# Disconnect
Remove-PSSession -Session $sfbSession

View File

@@ -0,0 +1,44 @@
# Enable Microsoft audio conferencing for a list of users
#
# Expects a CSV file with two columns, one containing the UserPrincipalName and the other containing the ServiceNumber.
#
# A list of dedicated conference numbers can be retrieved with:
# (Get-CsOnlineDialInConferencingBridge -Name 'Conference Bridge').ServiceNumbers | Where-Object {$_.IsShared -eq $false}
#
# If the service number entry for a user in the CSV file is blank then the default will be used.
#
# Where is the list of users?
$userListPath = 'C:\Temp\UserList.csv'
# Load the Skype Online Connector module and connect
Import-Module SkypeOnlineConnector
$sfbSession = New-CsOnlineSession
Import-PSSession -Session $sfbSession
# Get list of users from file
$users = Import-Csv -Path $userListPath
# Get the conference bridge details
$conferenceBridge = Get-CsOnlineDialInConferencingBridge -Name 'Conference Bridge'
# Enable conferencing for everyone on that list who doesn't already have it enabled
foreach ($user in $users) {
if (($user.ServiceNumber).Length -gt 0) {
$serviceNumber = $conferenceBridge.ServiceNumbers | Where-Object {$_.Number -eq $user.ServiceNumber}
}
else {
$serviceNumber = $conferenceBridge.DefaultServiceNumber
}
$currentProvider = (Get-CsOnlineDialInConferencingUserInfo -Identity $user.UserPrincipalName).Provider
if ($currentProvider -ne 'Microsoft') {
Enable-CsOnlineDialInConferencingUser -Identity $user.UserPrincipalName -ServiceNumber $serviceNumber.Number -ReplaceProvider -SendEmail
Write-Output -InputObject ('Audio conferencing enabled for ' + $user.UserPrincipalName + ' with number ' + $serviceNumber.Number + '.')
}
else {
Write-Output -InputObject ('Audio conferencing already enabled for ' + $user.UserPrincipalName + '.')
}
}
# Disconnect
Remove-PSSession -Session $sfbSession

View File

@@ -0,0 +1,18 @@
# Enable Modern Authentication in Skype for Business Online
#
# Load the Skype Online Connector module
Import-Module SkypeOnlineConnector
# Establish a session to Exchange Online
$sfbSession = New-CsOnlineSession
Import-PSSession -Session $sfbSession
# Enable modern authentication
Set-CsOAuthConfiguration -ClientAdalAuthOverride Allowed
# Verify the setting has changed
Get-CsOAuthConfiguration | Format-Table -AutoSize Identity,ClientAdalAuthOverride
# End the PS Session
Remove-PSSession -Session $sfbSession

View File

@@ -0,0 +1,74 @@
# Script to extract conferencing details for users from the AcpInfo setting
#
# Load the Skype Online Connector module
Import-Module SkypeOnlineConnector
# Establish a session to Exchange Online
$sfbSession = New-CsOnlineSession
Import-PSSession -Session $sfbSession
# Company Wildcard
$companyWildcard = '*'
# AcpInfo Wildcard
$acpInfoWildcard = '*BT*'
# Output file
$outputFile = 'C:\Temp\ConferencingUsers.csv'
# Get all conferencing users matching the above wildcarded info
$conferencingUsers = Get-CsOnlineUser -WarningAction:SilentlyContinue -ErrorAction:SilentlyContinue | Where-Object {($_.Company -like $companyWildcard) -and ($_.AcpInfo -like $acpInfoWildcard) -and ($_.Enabled -eq $true)} | Select-Object DisplayName,UserPrincipalName,AcpInfo
# Set up user details hash table
$userDetails = @()
# Run through the users, check if they're in the exclusions list and if not then pull the details out of the AcpInfo code
foreach ($conferencingUser in $conferencingUsers) {
$tollNumber = ''
if ([string]$conferencingUser.AcpInfo -match '<tollNumber>(?<tollNumber>.*)</tollNumber>') {
$tollNumber = $Matches.tollNumber
}
$tollFreeNumber = ''
if ([string]$conferencingUser.AcpInfo -match '<tollFreeNumber>(?<tollFreeNumber>.*)</tollFreeNumber>') {
$tollFreeNumber = $Matches.tollFreeNumber
}
$participantPassCode = ''
if ([string]$conferencingUser.AcpInfo -match '<participantPassCode>(?<participantPassCode>.*)</participantPassCode>') {
$participantPassCode = $Matches.participantPassCode
}
$domain = ''
if ([string]$conferencingUser.AcpInfo -match '<domain>(?<domain>.*)</domain>') {
$domain = $Matches.domain
}
$name = ''
if ([string]$conferencingUser.AcpInfo -match '<name>(?<name>.*)</name>') {
$name = $Matches.name
}
$url = ''
if ([string]$conferencingUser.AcpInfo -match '<url>(?<url>.*)</url>') {
$url = $Matches.url
}
$userDetails += [PSCustomObject]@{
'DisplayName' = [string]$conferencingUser.DisplayName
'UserPrincipalName' = [string]$conferencingUser.UserPrincipalName
'TollNumber' = [string]$tollNumber
'TollFreeNumber' = [string]$tollFreeNumber
'ParticipantPassCode' = [string]$participantPassCode
'Domain' = [string]$domain
'Name' = [string]$name
'Url' = [string]$url
}
}
# Output to CSV file
$userDetails | Export-Csv -Path $outputFile -NoTypeInformation
# End the PS Session
Remove-PSSession -Session $sfbSession

View File

@@ -0,0 +1,27 @@
# Script to bulk remove 3rd party conferencing details for all users
#
# Load the Skype Online Connector module
Import-Module SkypeOnlineConnector
# Establish a session to Exchange Online
$sfbSession = New-CsOnlineSession
Import-PSSession -Session $sfbSession -AllowClobber
# Company Wildcard
$companyWildcard = '*'
# AcpInfo to match (doesn't need to be the full name)
$acpInfoWildcard = '*BT*'
# Get all conferencing users matching the above info
$thirdPartyAcpUsers = Get-CsOnlineUser -WarningAction:SilentlyContinue -ErrorAction:SilentlyContinue | Where-Object {($_.Company -like $companyWildcard) -and ($_.AcpInfo -like $acpInfoWildcard) -and ($_.Enabled -eq $true)}
# Run through the users and remove their ACP info
foreach ($thirdPartyAcpUser in $thirdPartyAcpUsers) {
$acpInfoName = ([xml]$thirdPartyAcpUser.AcpInfo).acpInformation.name
Remove-CsUserAcp -Identity $thirdPartyAcpUser.Identity -Name $acpInfoName
}
# End the PS Session
Remove-PSSession -Session $sfbSession

View File

@@ -0,0 +1,26 @@
# Script to bulk remove conferencing details for a list of users
#
# Where is the list of user UPN's?
$userListPath = 'C:\Temp\UserList.txt'
# Load the Skype Online Connector module
Import-Module SkypeOnlineConnector
# Establish a session to Exchange Online
$sfbSession = New-CsOnlineSession
Import-PSSession -Session $sfbSession -AllowClobber
# Import list of users from file
$userList = Get-Content -Path $userListPath | Sort-Object
# Get CS Online user identities for all the users in the list
$csOnlineUsers = (Get-CsOnlineUser -WarningAction SilentlyContinue | Where-Object {$_.UserPrincipalName -in $userList}).Identity
# Run through the users and remove their ACP info
foreach ($csOnlineUser in $csOnlineUsers) {
Remove-CsUserAcp -Identity $csOnlineUser
}
# End the PS Session
Remove-PSSession -Session $sfbSession

View File

@@ -0,0 +1,41 @@
# Update Microsoft audio conferencing for a list of users
#
# Expects a CSV file with two columns, one containing the UserPrincipalName and the other containing the ServiceNumber.
#
# A list of dedicated conference numbers can be retrieved with:
# (Get-CsOnlineDialInConferencingBridge -Name 'Conference Bridge').ServiceNumbers | Where-Object {$_.IsShared -eq $false}
#
# If the service number entry for a user in the CSV file is blank then the default will be used.
#
# Where is the list of users?
$userListPath = 'C:\Temp\UsersToUpdate.csv'
# Load the Skype Online Connector module and connect
Import-Module SkypeOnlineConnector
$sfbSession = New-CsOnlineSession
Import-PSSession -Session $sfbSession
# Get list of users from file
$users = Import-Csv -Path $userListPath
# Get the conference bridge details
$conferenceBridge = Get-CsOnlineDialInConferencingBridge -Name 'Conference Bridge'
# Enable conferencing for everyone on that list who doesn't already have it enabled
foreach ($user in $users) {
if (($user.ServiceNumber).Length -gt 0) {
$serviceNumber = $conferenceBridge.ServiceNumbers | Where-Object {$_.Number -eq $user.ServiceNumber}
}
else {
$serviceNumber = $conferenceBridge.DefaultServiceNumber
}
$currentTollNumber = (Get-CsOnlineDialInConferencingUserInfo -Identity $user.UserPrincipalName).DefaultTollNumber
if ($currentTollNumber -ne $user.ServiceNumber) {
Set-CsOnlineDialInConferencingUser -Identity $user.UserPrincipalName -ServiceNumber $serviceNumber.Number -SendEmail
Write-Output -InputObject ('Audio conferencing updated for ' + $user.UserPrincipalName + ' with number ' + $serviceNumber.Number + '.')
}
}
# Disconnect
Remove-PSSession -Session $sfbSession