Comments (2)
It could be simplified further- I've rewritten it in place to make it easier for you to update the wiki. Please do this-- your example runs for hours, whereas this runs for seconds! I've removed the warning about time taken.
It changes the code from O(n) to O(1) (almost), as Get-Team runs for over a minute each time for me.
Install-Module -Name MicrosoftTeams -Repository PSGallery
Connect-MicrosoftTeams
$TeamList = @()
Write-Host ""
Foreach ($Team in Get-Team)
{
$TeamGUID = $Team.GroupId.ToString()
$TeamName = $Team.DisplayName
$TeamList = $TeamList + [PSCustomObject]@{TeamName = $TeamName; TeamObjectID = $TeamGUID}
}
#######
from microsoft-teams-apps-classroom-dropin.
I've got it in two scripts at the moment to first rip all the information of all the teams id's then append the teachers names to each of the classes and import it directly to sharepoint, even if there's multiple teachers so that when you're searching for the team you can search by teachers name instead of just the class name, also because we run a high school it needs to be done each semester, only thing i haven't added is school name.
edit: Updated script to force install ms teams to prevent issues when needing to update, also forced only active classes instead of archived ones as well.
Install-Module -Name MicrosoftTeams -Repository PSGallery -force
Connect-MicrosoftTeams
$AllTeamsInOrg = (Get-Team -Archived $false).GroupID
$TeamList = @()
Write-Output "This may take a little bit of time... Please sit back & relax!"
Write-Host ""
Foreach ($Team in $AllTeamsInOrg)
{
$TeamGUID = $Team.ToString()
$TeamName = (Get-Team -GroupId $TeamGUID).DisplayName
$TeamList = $TeamList + [PSCustomObject]@{TeamName = $TeamName; TeamObjectID = $TeamGUID}
}
$TestPath = test-path -path 'c:\temp'
if ($TestPath -ne $true) {New-Item -ItemType directory -Path 'c:\temp' | Out-Null
write-Host 'Creating directory to write file to c:\temp. Your file is uploaded as TeamsData.csv'}
else {Write-Host "Your file has been uploaded to c:\temp as 'TeamsData.csv'"}
$TeamList | export-csv c:\temp\TeamsData.csv -NoTypeInformation
Then once thats complete a second one that probably could just be appended to the end, but test that its gotten the correct information first as deleting from sharepoint is slow as hell.
Install-Module SharepointPNPPowershellOnline
Set-ExecutionPolicy Undefined -Scope CurrentUser
Connect-MicrosoftTeams
$SiteUrl = "https://<replacewithyourdomain>/sites/ClassroomDrop-in"
$ListName = "Teams"
$CSVPath = "c:\temp\TeamsData.csv"
$CSVData = Import-CsV -Path $CSVPath
Connect-PnPOnline $SiteUrl -UseWebLogin
ForEach ($Row in $CSVData){
$ownerColl=Get-TeamUser -GroupId $($Row.TeamObjectID) -Role Owner
foreach($owner in $ownerColl){
Add-PnPListItem -List $ListName -Values @{"Teacher"= $owner.Name;
"Title" = $($Row.TeamName);
"TeamID" = $($Row.TeamObjectID);
};
}
}
from microsoft-teams-apps-classroom-dropin.
Related Issues (20)
- SharePoint list result size is limited to 500 items when using the API in PowerApps. HOT 3
- Run the SharePoint List deployment flow
- SDS integration? HOT 3
- Powershell Code revision
- Start Time granularity? Able to select multiple Teams at the same time to Drop-in ?
- No data returned from Schools Form
- ClassroomDrop-in.zip App Upload HOT 3
- Step 8: Adding data to 'Schools' & 'Timeslot' list HOT 3
- Blank Screen when running app
- Synchronising with School Data Sync HOT 2
- Flow for Drop checks for email address
- Unable to update definitions HOT 1
- Drop in flow issue
- scheduled drop-in doesn't show HOT 1
- Power App Import error HOT 1
- Drop in cancel
- Setting up the importdatasflow HOT 1
- Does This app support SDS? HOT 1
- SDS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft-teams-apps-classroom-dropin.