This repository contains automation PowerShell scripts for common Azure AD management scenarios such as:
- Connect to Azure AD
- Create New Users
- Delete Existing Users
- Add User to Group
- Remove user from Group
- Get Current License Status
- Assign License
- Remove License
- Add Azure Application
- Remove Azure Application
- Enable MFA/ Force MFA For Users
- Disable MFA For Users
- Recover Deleted Object We Will Explain each Option:
The script will connect to Azure AD and here you have two option • Uncomment the 4 lines code and store you credentials if you don’t like to keep entering them every time • do not change the function and you will be able to connect with new credential every time
The Script Will create one or multiple users in Azure AD as per data filled in CSV file The CSV has the below columns: • Firstname, MiddleInitials, Lastname, Department, JobTitle, Country, Mobile, Password, UserPrincipalName, MailNickName
UserPrincipalName, are MailNickName optional fields You need just to fill the CSV file and confirm on shell before you start the operation
You can delete single or multiple users thru the CSV file, you just have to fill either UserPrincipalName or MailNickName
You can add single or multiple users into the specific group thru the CSV file, you just have to fill either UserPrincipalName or MailNickName, the script will list all group you have and then you can select the desire group
You can remove single or multiple users from the specific group thru the CSV file, you just have to fill either UserPrincipalName or MailNickName, the script will list all group you have and then you can select the desire group
The script will list the available and the consumed licenses
You can assign license for single or multiple users thru the CSV file, you just have to fill either UserPrincipalName or MailNickName, the script will list all licenses you have and then you can select the desire license you want to assign
You can unassign license for single or multiple users thru the CSV file, you just have to fill either UserPrincipalName or MailNickName, the script will remove all licenses you assigned for them
Create an Azure AD application that can access resources
The Script will list all Azure AD application and then you can select which one you want to remove
You can Enable and enforce MFA for single or multiple users thru the CSV file, you just have to fill either UserPrincipalName or MailNickName, the script will enable or enforce based on that
You can Disable MFA for single or multiple users thru the CSV file, you just have to fill either UserPrincipalName or MailNickName
The script will list all deleted object from Azure AD and then you can select which object you which to recover