Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This script will update address book policy by user attributes
$logfile = ".\ABP-UpdateUsersAttributeslog_$(get-date -format `"yyyyMMdd_hhmmsstt`").txt"
$start = [system.datetime]::Now
If(Get-Module -ListAvailable -Name AzureAD)
{
Write-Host "AzureAD Already Installed"
}
else {
try { Install-Module -Name AzureAD
Write-Host "Installing AzureAD"
}
catch{
$_.Exception.Message | out-file -Filepath $logfile -append
}}
if(Get-Module -ListAvailable -Name ExchangeOnlineManagement)
{
Write-Host "ExchangeOnlineManagement Already Installed"
}
else {
try {
Install-Module -Name ExchangeOnlineManagement
Write-Host "ExchangeOnlineManagement is installing"
}
catch{
$_.Exception.Message | out-file -Filepath $logfile -append
}}

try{
$credential= get-credential
Connect-AzureAD -Credential $credential
Connect-ExchangeOnline -credential $credential
}
catch{
$_.Exception.Message | out-file -Filepath $logfile -append
}
#Setting custom Attribute for Students
$group = Get-AzureADGroup -SearchString "Students of" -All $true
foreach ($group in $group){
$school= $group.displayname
$school = $school -replace("students of","")
$school=$school.Where({ $_ -ne "" })
$school=$school.Trim()
try{
$group | Get-AzureADGroupMember | Get-EXOMailbox | Set-Mailbox -CustomAttribute10 $school
}catch{
$_.Exception.Message | out-file -Filepath $logfile -append
}}

#Setting custom Attribute for teachers
$group = Get-AzureADGroup -SearchString "teachers of" -All $true
foreach ($group in $group){
$school= $group.displayname
$school = $school -replace("teachers of","")
$school=$school.Where({ $_ -ne "" })
$school=$school.Trim()
try{
$group | Get-AzureADGroupMember | Get-EXOMailbox | Set-Mailbox -CustomAttribute10 $school
}
catch{
$_.Exception.Message | out-file -Filepath $logfile -append
}}
$end = [system.datetime]::Now
$resultTime = $end - $start
Write-Host "Execution took : $($resultTime.TotalSeconds) seconds." -ForegroundColor Cyan
#end of script
26 changes: 26 additions & 0 deletions Address book policy-UpdateUserAttributes-EducationDomain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Address book policy-UpdateUserAttributes

# Description
Script will check all groups of teachers, students and removes the part “students of” or “teachers of” and then it will update the user custom attribute with the school name, this way we can have both teachers, students of the same school can share the same attribute value

System should have the AzureADPreview module [`Install-Module AzureADPreview`](https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-adv2?view=azureadps-2.0-preview#installing-the-azure-ad-module) and [`Exchange Online`](https://docs.microsoft.com/en-us/powershell/module/exchange/connect-exchangeonline?view=exchange-ps) to exceute the script

# Inputs
Global Administrator or Azure AD Administrator and ExchangeOnline Administrator credentials

# Prerequisites
Exchange Online and AzureAD module

# How to run the script
As an Administrator, type PowerShell in the start menu. Right-click on Windows PowerShell, then select run as Administrator. Click Yes at the UAC prompt

Run the script

Provide the Global Administrator credentials or AzureAD and ExchangeOnline Administrator credentials when it prompts

Hit enter to continue

# Expected output
User custom attributes are updated

A log file will be generated with exceptions, errors along with script execution time
67 changes: 67 additions & 0 deletions Call Quality Dashboard Report/Call Quality Dashboard Report.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This script will provide Total stream count and cqd report of given time using Teams powershell cqd module cmdlets
$start = [system.datetime]::Now
$logfile = ".\CQDLog_$(get-date -format `"yyyyMMdd_hhmmsstt`").txt"

$proceed = Read-host "
Provide 1 For Total Steram count including Audio,video,Appsharing
Provide 2 for CQD Report of Given time"
if ($proceed -eq "1")
{
try{
write-host "Provide startDate and Enddate in MM/dd/yyyy H:mm(Ex:31-03-2020 4:34)"

$StartDate = read-host "Please provide start date"
$EndDate = read-host "please provide end date"

$dimensions = "AllStreams.Date","AllStreams.Media Type","AllStreams.Second UPN"
$measures = "Measures.Total Stream Count","Measures.Audio Stream Count","Measures.Video Stream Count","Measures.AppSharing Stream Count","Measures.VBSS Stream Count"
#"Measures.Call Count","Measures.Audio Call Count","Measures.Video Call Count"

$CustomFilter = @()
$F1 = New-Object pscustomobject
$F1 | Add-Member -Type NoteProperty -Name FName -Value "AllStreams.Is Teams"
$F1 | Add-Member -Type NoteProperty -Name FValue -Value "1"
$F1 | Add-Member -Type NoteProperty -Name Op -Value 0
$CustomFilter += $F1

$F2 = New-Object pscustomobject
$F2 | Add-Member -Type NoteProperty -Name FName -Value "AllStreams.Second UserType"
$F2 | Add-Member -Type NoteProperty -Name FValue -Value "User"
$F2 | Add-Member -Type NoteProperty -Name Op -Value 0
$CustomFilter += $F2

$CQDTableTemp= Get-CQDData -OutPutType CSV -OutPutFilePath cqdoutput.csv -CQDVer V3 -LargeQuery -StartDate $StartDate -EndDate $EndDate -IsServerPair 'Client : Server','Client : Client' `
-Dimensions $dimensions -Measures $measures -customfilter $CustomFilter -ShowQuery $true
}
catch
{
$_.Exception.Message | out-file -Filepath $logfile -append
}
}

if ($proceed -eq "2")
{
try{
$cqd_List = Import-Csv -path ".\CQD_data.csv"


Foreach ($cqd in $cqd_List)
{

Get-CQDData -Dimensions $cqd.Dimensions -Measures $cqd.Measures -OutPutFilePath $cqd.OutPutFilePath -StartDate $cqd.StartDate -EndDate $cqd.EndDate -OutPutType $cqd.OutPutType -MediaType $cqd.MediaType -IsServerPair $cqd.IsServerPair -OverWriteOutput
}
}
catch
{
$_.Exception.Message | out-file -Filepath $logfile -append
}
}

Else {
write-host "Please run the script again choose option 1 or 2"
}
$end = [system.datetime]::Now
$resultTime = $end - $start
Write-Host "Execution took : $($resultTime.TotalSeconds) seconds." -ForegroundColor Cyan
#end of script

85 changes: 85 additions & 0 deletions Call Quality Dashboard Report/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Call Quality Dashboard Report

# Description

Script will provide total stream count including audio, video, app sharing for provided start time and end time, CQD report of a given time

PowerShell should be more than 3.0 version

# Example

##### Example 1 for total stream count including audio, video, app sharing

![Example](https://github.com/Geetha63/MS-Teams-Scripts/blob/master/Images/CQD-Example.png)

##### Example 2 for CQD report of the given time (DD-MM-YYYY(Ex:31-03-2020)

Start Date: 1-10-2020

End Date: 1-11-2020

# Parameters

`-Date`

Type: String

# Inputs

Provide input 1 to get total stream count including audio, video, app sharing

Start Date – “Please provide start date"

End Date – “Please provide end date"

Provide input 2 to get the CQD report of a given time

Give the input file as shown below. Keep this file in current location(CQD_Input.csv). The script will collect the data from `CQD_Input.csv` file and capture the data from call quality dashboard

|Dimensions | Measures| OutPutFilePath | StartDate| EndDate | OutPutType | MediaType | IsServerPair |
|------------|---------|----------------|-----------|---------|------------|-----------|--------------|

Each row data will be collected and executed through script accordingly

To construct the input.csv file refer [dimensions-and-measures-available-in-call-quality-dashboard](https://docs.microsoft.com/en-us/microsoftteams/dimensions-and-measures-available-in-call-quality-dashboard)

# Procedure

PowerShell should be more than 3.0 version

Run the script

Once you run the script it will prompt for option 1 or 2

If you have chosen the **option 1** please provide the parameters

Start Date – “Please provide start date”

End Date – “Please provide end date”

Press enter to continue

Or if you have chosen the **option 2** please provide the `Input.csv` file

Now the script will pop-up for Teams Administrator credentials to connect the CQD tool

![Signin](https://github.com/Geetha63/MS-Teams-Scripts/blob/master/Images/CQD-Signin.png)

Provide the Teams Administrator credentials

# Output

For option 1

##### Example output

Script will execute and creates `cqdoutput.csv` file
![SampleOutput](https://github.com/Geetha63/MS-Teams-Scripts/blob/master/Images/CQD-SampleOutput.png)

For option 2

##### Example output

![Output](https://github.com/Geetha63/MS-Teams-Scripts/blob/master/Images/CQD-output.png)

A log file will be generated with exceptions, errors along with script execution time
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This script will create and assign addressbook policy
$logfile = ".\CreateAndAssignAddressbookPolicylog_$(get-date -format `"yyyyMMdd_hhmmsstt`").txt"
$start = [system.datetime]::Now
if(Get-Module -ListAvailable -Name ExchangeOnlineManagement)
{
Write-Host "ExchangeOnlineManagement Already Installed"
}
else {
try {
Install-Module -Name ExchangeOnlineManagement
Write-Host "ExchangeOnlineManagement is installing"
}
catch{
$_.Exception.Message | out-file -Filepath $logfile -append
}
}
#Creating and assigning address policy
try{
$cred = Connect-ExchangeOnline
$user= Get-Mailbox -ResultSize unlimited
$school = $user.CustomAttribute10 | Sort-Object | Get-Unique
$school=$school.Where({ $_ -ne "" })
$school=$school.Trim()
foreach ($school in $school)
{
New-AddressList -Name $school -ConditionalCustomAttribute10 $school -IncludedRecipients "AllRecipients"
$addresslist = (Get-AddressList $school).name+' GAL'
New-GlobalAddressList -Name "$addresslist" -ConditionalCustomAttribute10 $school -IncludedRecipients "AllRecipients"
$GAL= $school+' GAL'
New-OfflineAddressBook -Name $school -AddressLists "\$gal"
New-AddressBookPolicy -Name $school -AddressLists "\$school" -RoomList "\All Rooms" -OfflineAddressBook "$school" -GlobalAddressList "$gal"
Get-Mailbox | where{$_.customattribute10 -like "*$school*"} | Set-Mailbox -AddressBookPolicy $school
}
}
catch{
$_.Exception.Message | out-file -Filepath $logfile -append
}
$end = [system.datetime]::Now
$resultTime = $end - $start
Write-Host "Execution took : $($resultTime.TotalSeconds) seconds." -ForegroundColor Cyan
#end of script
29 changes: 29 additions & 0 deletions CreateAndAssignAddressBookPolicy-EducationDomain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CreateAndAssignAddressBookPolicy-EducationDomain

# Description

Script will create and assign the address lists, address book policies to users based on the attribute

A log file will be generated with exceptions, errors along with script execution time

# Inputs
Global Administrator or ExchangeOnline Administrator credentials

# Prerequisites
As an Administrator, type PowerShell in the start menu

Right-click on Windows PowerShell, then select Run as Administrator. Click Yes at the UAC prompt
1. Type the following within PowerShell and then press Enter:

`Import-Module ExchangeOnlineManagement`

`$UserCredential = Get-Credential`

2. In the Windows PowerShell credential request dialog box that appears, type global or exchange online admin account and password, and then click OK

# How to run the script
To run the script you will need to either download it or copy and paste the script into PowerShell

Provide the Global Administrator credentials or exchange online Administrator credentials when it prompts

Hit enter to continue
49 changes: 49 additions & 0 deletions Group or TeamsCreationRestrictionPolicy-Bulk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Group or TeamsCreationRestrictionPolicy-Bulk

# Description

You can restrict Office 365 group creation to the members of a particular security group

Office 365 global admins can create groups via any means, such as the Microsoft 365 admin center, Planner, Teams, Exchange, and SharePoint Online

The system should have the AzureADPreview module [`Install-Module azure preview`](https://docs.microsoft.com/en-us/powershell/azure/active-directory/install-adv2?view=azureadps-2.0-preview#installing-the-azure-ad-module)

# Example
Restricting HR group members from creating Teams or groups

# Inputs
Import _GroupTeamsCreationRestrictionPolicy.xlsx_ file as an input which contains Groupname and AllowGroupCreation, Please refer example table

| Groupname | AllowGroupCreation |
|--------------|-------------------- |
| Group1 | True |
| HR | False |

# Parameters
Groupname: The name of the created O365 security group

AllowGroupCreation: Do You want to allow this group to create Teams True/False

# Prerequisites
As an Administrator, type PowerShell in the start menu
Right-click Windows PowerShell, then select Run as Administrator. Click Yes at the UAC prompt.
1. Type the following within PowerShell and then press Enter:

`Install-Module AzureAd`

2. Type Y at the prompt. Press Enter

3. If you are prompted for an untrusted repository, then type A (Yes to All) and press Enter. The module will now install

# How to run the script
To run the script you will need to either download it or copy and paste the script into PowerShell

Provide the Global Administrator credentials or AzureAD Administrator credentials when it prompts

The script will restrict or allow the group users based on AllowGroupCreation input

# Output
The last line of the script will display the updated settings:
![output](https://github.com/Geetha63/MS-Teams-Scripts/blob/master/Images/Restricting%20group%20creation.png)

A log file will be generated with exceptions, errors along with script execution time
Loading