Skip to content

nahisaho/M365AdminTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M365AdminTools

This project contains tools for managing Microsoft 365 environments using Microsoft Graph API. These tools help administrators automate common tasks such as user management, exporting user details, and cleaning up deleted user objects.

Features

  • User Management: Retrieve, create, and delete users within your Microsoft 365 environment.
  • Export to CSV: Export user details to a CSV file for reporting and analysis.
  • Cleanup Deleted User Objects: Automatically remove deleted user objects to keep your environment clean and organized.

Getting Started

Prerequisites

  • PowerShell 7.x
  • Microsoft 365 account with appropriate permissions to use Microsoft Graph API

Installation

  1. Change directory to the $HOME

    cd $HOME
  2. Clone the repository:

    git clone https://github.com/yourusername/M365AdminTools
  3. Navigate to the project directory:

    cd M365AdminTools
  4. Add $HOME\M365AdminTools\scripts to the $PATH:

    ./setup.ps1

Configuration

  1. Copy the sample credentials file and rename it:

    cd scripts
    cp credentials.json.sample credentials.json
  2. Edit the credentials.json file and enter your Tenant Id, Client Id, and Client Secret:

    {
        "tenantId": "your-tenant-id",
        "clientId": "your-client-id",
        "clientSecret": "your-client-secret"
    }

Usage

Manage License

  • To retrieve Microsoft 365 license information

    ./get-m365-license.ps1

User Management

  • To retrieve users:

    ./get-m365-users.ps1 [-Outputfile <outputsile>]
  • To create a user:

    ./add-m365-users.ps1 -Inputfile <Inputfile>  [-Outputfile <outputsile>]
  • To delete a user:

    ./remove-m365-users.ps1 -Inputfile <Inputfile>  [-Outputfile <outputsile>]
  • To clean up deleted user objects:

    ./cleanup-m365-deleted-users.ps1
  • To create a Temporary Access Pass:

    ./create-tap.ps1 -Inputfile <Inputfile>  [-Outputfile <outputsile>]

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors