Automating Teams School Data Sync – iSAMS

My two SDS profiles, automatically updated from the MIS

I don’t like things that can’t be automated. I started looking at School Data Sync (SDS) last year, however the templates provided by iSAMS, which is our school Management Information System, just gave a set of CSVs and you had to manually click to get them, then click to upload them into SDS. Since iSAMS has an API, I thought this was a bit of a silly way of doing things – who wants to go through a manual process every time a pupil changes class? So instead I wrote my own powershell to pull the data through the iSAMS API, then run through the New-Team cmdlet to create a team per class, and populate it with teachers and students.

As we’re a school we need our new teams to be running the Edu_Class template, but the template parameter on New-Team only exists in the preview (and in Graph, on the beta endpoint) where it has much harsher limitations on how often and fast you can call it – a nightmare trying to call it in a loop. Anyway with the addition of “Start-Sleep 30” in the loop I eventually got them all created. However this time I am having another look at SDS and using Power Automate (previously known as Flow) to make the process completely automatic.

Continue reading “Automating Teams School Data Sync – iSAMS”

PHP: Mailing through Office 365 using the Graph API

The Graph API is a great way to get your application to send/receive mail through Office 365 in the background

A while ago I needed to update my PHP applications mail handing scripts, as Microsoft are disabling basic authentication and they connected using EWS with basic authentication. I took the opportunity to update them to use the Microsoft Graph API instead.

My systems generally run mail as a background process, e.g. sending/receiving mail to the helpdesk mailbox, so this article is written in that vein. If you wanted to access mail in an interactive way (so the user is sat in front of the browser at the time mail is accessed) you’d need to switch to Delegated rights, rather than Application, and the user would log in rather than the script logging in. I’ve not looked at this so not able to say much more about it.

Continue reading “PHP: Mailing through Office 365 using the Graph API”

Applying Teams Policies to a group

(Updated 4th Sept 2020: Use New-CsBatchPolicyPackageAssignmentOperation instead of Grant-CsUserPolicyPackage now)

Teams Policy Packages

I’ve recently needed to apply a PolicyPackage to a group of users (well 2 packages to 2 groups) using PowerShell – as the Teams Admin centre only allows you to apply to users by typing in all the names one at a time and pressing Add and discovered the New-CsGroupPolicyAssignment cmdlet, which looks good – however this applies a policy to a group, but I want to apply a policy package.

Instead we can use New-CsBatchPolicyPackageAssignmentOperation and pass it an array of UPNs (max 5000 in one go) along with the policy package name.
Continue reading “Applying Teams Policies to a group”

Office 365 mailto: Link Handler

Clicking a mailto: link will allow the user to select whether they want to use Outlook on the Web or the full blown Outlook.EXE client

I’ve been looking for a way to get mailto: links in websites open in Office 365 (Outlook Web) rather than the full Outlook client – as we have Outlook installed on our network, but unconfigured as everybody uses the web version.
I wrote something about 10 years ago which did this when we had a local Exchange box, although it’s since been lost as it no longer worked when we updated from Exchange 2003 to Exchange 2007. I’ve since written a new one which works with Office 365! Continue reading “Office 365 mailto: Link Handler”

Office 365 Automated Signature Generator

I’ve been looking for a while at a way to automate email signatures for everybody using OWA on Office 365. The new layout we want for our signatures includes images and everywhere I’ve read says it’s impossible to embed images in a signature set using Powershell. (Note I want them embedded rather than hotlinked).
The solution I came up with takes details from the Active Directory user account – I’m using the description field to insert the person’s name (to allow things like “Mrs Blah” rather than just outputting firstname surname), fields like title (job title), telephone, mobile and also using a few of the extensionAttributes for the Twitter/Facebook links. All of these are standard fields so no need to mess with the AD schema. Continue reading “Office 365 Automated Signature Generator”