Skip to content

Instantly share code, notes, and snippets.

View keslar's full-sized avatar

Chris Keslar keslar

View GitHub Profile
@keslar
keslar / Export-TelephoneNumbers.ps1
Last active February 21, 2022 20:56
Teams Exports
$Assignmentsc = @()
$TelephoneNumbers = (Get-CsOnlineTelephoneNumber -ResultSize 1000000)
ForEach ( $TelephoneNumber in $TelephoneNumbers ) {
$Assignment = Get-CsOnlineTelephoneNumber -TelephoneNumber $TelephoneNumber -ExpandLocation | Select-Object id, inventorytype, userid, @{Name="CivicAddressId";Expression={"$($_.Location.CivicAddressId)"}},@{Name="LocationId";Expression={"$($_.Location.LocationId)"}}
$Assignments += $Assignment
}
$FileName = "$(Get-Date -F yyy-MM-dd)_Assignments.csv"
$Assignments | Export=CSV -NoTypeInformation -Path $FileName
$CivicAddresses = Get-CsOnlineLisCivicAddress -ResultSize 1000000 | Select-Object CivicAddressId,HouseNumber,HouseNumberSuffix,PreDirectional,StreetName,StreetSuffix,PostDirectional,City,CityAlias,PostalCode,StateOrProvince,CountryOrRegion,Description,CompanyName,DefaultLocationId,ValidationStatus,Latitude,Longitude,Elin
@keslar
keslar / Clean-MSTeamsCache.ps1
Last active July 18, 2023 19:48
Scratch space
#!/usr/bin/env pwsh
#requires -version 3
<#
.SYNOPSIS
Clean out the Microsoft Teams cache
.DESCRIPTION
.PARAMETER AllUsers
Clean out the Teams cache directory for all profile on the workstation that have a Teams cache directory