Claude Code can build your SharePoint term store from a spreadsheet. Give it a workbook where each tab is a term set and each row is a term, tell it the group name, and it writes the PowerShell, runs it and works through most of its own errors. It still needed me to spot one failure, and the whole thing took a few rounds of back and forth while I got on with other work.
The term store was one piece of an information architecture I was deploying. The hard part, deciding which document types exist and what they’re called, was already done and sitting in a spreadsheet. Typing those terms into the admin centre one by one, or writing the deployment script myself, was the part I wanted to hand off.
What I gave Claude Code
I used Claude Code inside Visual Studio Code, working in a local folder. The workbook had one tab per term set, with the terms listed in column A under a “Document type” header.
The prompt, cleaned up a little:
I’ve got a spreadsheet made up of several tabs. Each tab is a term set, and each tab lists the terms I want in that term set. First create a term group called Global Terms. Name each term set the same as its tab, and use the values in column A as the terms. Please help me deploy this to the global term store of my tenant.
Then I attached the spreadsheet with an @ mention. Claude Code read the file, reported how many term sets and terms it found, noticed the header row on every tab and excluded it without being asked, and wrote a PnP PowerShell deployment script.
What went wrong, and how it recovered
Nothing worked first time, and I didn’t cut anything out of the video.
- Wrong address. The script guessed the tenant’s admin URL. I gave it the right one.
- Missing module. PnP PowerShell wasn’t installed, so Claude Code installed it.
- Wrong PowerShell. It tried PowerShell 5, found PnP needs PowerShell 7, checked whether 7 was installed (it was) and switched.
- App registration. Current versions of PnP PowerShell need your own Entra ID app registration. I’d registered one for PnP in this tenant before, so I gave Claude Code the client ID and it updated the script.
- False success. The script opened a browser sign-in, ran, and reported that it had created the term group. In the SharePoint admin centre, the Global Terms group existed but was empty.
I told Claude Code the group was there but the term sets and terms weren’t. It wrote a verification script, confirmed the group was empty, and recognised that the index errors it had seen earlier were real failures. It then rewrote the deployment to connect to a regular site rather than the admin site and use the CSOM taxonomy API instead of the PnP cmdlets. That version worked. I refreshed the term store and every term set and term was there.
Put the check in the first prompt
The empty term group cost me a round trip. Next time I’ll put the check in the first prompt: “When you’ve finished, verify the term sets and terms exist in the term store and fix anything that’s missing.”
Whatever agent you use, tell it what done looks like and ask it to check its own result before it reports back. Then open the admin centre and look for yourself before you move on, the way I found the empty group.
Decide the design, then hand over the deployment
Claude Code didn’t design anything here. The term sets, their names and the document types came from information architecture work done beforehand. What Claude Code took off my plate was the deployment: parsing a workbook, writing a script, chasing module versions and authentication.
I’d use an agent the same way for other repetitive provisioning, like creating sites from a list or adding the same columns to a set of libraries, with the design settled first and someone who knows SharePoint checking the result.
Before a job like this, ask whether an agent could do it while you work on something else. I was creating sites and answering email while Claude Code worked through the script.
Once the terms exist, they’re only useful as managed metadata columns on your libraries. SharePoint folders vs metadata covers why columns beat folders, and why your SharePoint needs an information architecture before AI covers the design work that comes first.
Frequently asked questions
What is the SharePoint term store? It’s the central place in SharePoint for managed metadata: term groups, term sets and terms that libraries across your tenant can use in managed metadata columns. You manage it in the SharePoint admin centre under Content services, Term store.
What permissions does Claude Code need to deploy to the term store? It runs scripts under your sign-in, so you need term store admin or SharePoint admin rights yourself. Claude Code doesn’t get any access you don’t already have.
Why does PnP PowerShell ask for a client ID? Current versions of PnP PowerShell no longer use a shared multi-tenant app, so each tenant needs its own Entra ID app registration with the right permissions. You pass its client ID when you connect.
Do I need to connect to the SharePoint admin site to change the term store? Not in my run. The version that worked connected to a regular SharePoint site and reached the term store through the CSOM taxonomy API, which avoided the errors the PnP cmdlets hit against the admin site.
Do I have to use Visual Studio Code to run Claude Code? No. I used the Visual Studio Code extension so I could see the files alongside the chat, but Claude Code also runs in a terminal.