Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.64 KB

README.md

File metadata and controls

37 lines (29 loc) · 1.64 KB

graph-tasks-scripts

A collection of useful/not useful scripts to do queries against Microsoft Graph API

Set up

  • Clone the repository to a place you want to run scripts from
  • Set up a .env file with required values
GRAPH_CLIENT_ID=client-id from app reg
GRAPH_CLIENT_SECRET=client-secret from app reg
GRAPH_TENANT_ID=your tenant-id
GRAPH_SCOPE=https://graph.microsoft.com/.default or something else you need

Scripts

GetAllTeams (currently gets all groups...)

Script GetAllTeams

  • Set up config if you need something else than default
  • Run from VSCode

image

ansattoversikt-til-nettside (currently gets all groups...)

Script ansattoversikt-til-nettside

  • Set up config if you need something else than default
  • Run from VSCode

image

How to create a new script

  • Inside the scripts folder, create a new folder with the name of the script.
  • Then inside the new folder create config.js file if needed and an index.js file.
  • Then create a new NPM script in the package.json file with the name of the script like this: "name-of-the-script": "node "scripts/name-of-the-script/index.js""
  • All the scripts can be found in "NPM SCRIPTS" in vscode like seen in the pictures above.