Code Monkey home page Code Monkey logo

exchangeeventgenerator's Introduction

An event generator for Microsoft Exchange

Hack Together: Microsoft Graph and .NET

This is a service worker which can create "random" events for every member of an organization utilizing the Microsoft Graph API.

Basically simulating activity within an organization.

How it works

The service worker will run every X minutes to create events:

  • Events are based on event templates eventTemplates.json
  • A random date and time within the lookahead is applied to each of these events
  • A random amount of users within the organization is chosen
  • A random amount of events is created for them

Requirements

  • .NET v7.0
  • Azure subscription with admin privileges for the target tenant

Setup

  1. Add a new app registration to your target tenant
  2. Create a certificate on your local machine and upload it for the authentication with azure
    e.g. follow the first half of this guide
  3. Add the following app permissions on azure: "User.Read.All" and "Calendars.ReadWrite"
  4. Add your tenant id, client id and certificate thumbprint to the appsettings file
  5. In that file you can also adjust the "settings" section to your liking
  6. (Optional) Adjust event templates:

Event Template Layout

Property Description Expected Value
Id An identifier for the event template A number unique to this event
Subject The subject of the event A string defining the subject
Content The content of the event A string defining the content
IsAllDay Defining if the event is all day Either true or false
Duration Duration of the event, only required if IsAllDay is false A string defining the duration (e.g. "2:00" for 2 hours)
Reminder How many minutes ahead should the event remind the user A number defining the minutes
Recurrence The recurrence type of the event "" or "daily" or "weekly" or "monthly" or "yearly"
DaysOfWeek The day of the week the event should start at, only required if recurrence is set A string containing weekdays separated by commas (e.g. "monday" or "monday,tuesday")
NumberOfOccurrences How many times the event should recurr, only required if recurrence is set A number defining how many times to repeat a recurring event
Importance The importance of the event "low" or "normal" or "high"
ShowAs The status of the event for its owner "free" or "tentative" or "busy" or "oof" or "workingElsewhere" or "unknown"
Attachments A list of attachments A string containing attachment names in the Attachment folder separated by commas (e.g. "Lorem Ipsum.pdf" or "Lorem Ipsum.pdf,Lorem Picsum.jpg")

Usage

dotnet run

Notes

  • If it states "Failed" for the creation of an event, then that means that it could not find a timeslot within the specified restrictions.
  • Try to avoid adding many reccuring events (especially daily ones) as it will fill the calender boringly.
  • Adding attendees to an event is currently not implemented. I was not able to test this feature, as i was using the azure testversion, where sending mails via the graph API is not allowed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.