This PowerShell script is designed to retrieve Multi-Factor Authentication (MFA) status information for each user within an organization. It ensures the user has the necessary administrative privileges, connects to Azure AD, and exports the MFA status report.
- Checks for Administrator privileges and prompts for elevation if necessary.
- Displays a warning message regarding script's capabilities.
- Checks for and installs missing required modules.
- Initializes log file with timestamps for tracking actions.
- Retrieves information for multiple accounts, with the option to specify email address or label for each export.
- Exports MFA Status Report containing details like UserPrincipalName, DisplayName, MFAStatus, PreferredMFA, PhoneNumber, MainEmailAddress, and EmailAliases.
- PowerShell
- Administrator Privileges
- Required Modules: AzureAD, MSOnline
-
Clone the Repository
git clone https://github.com/username/repository-name.git
-
Navigate to Project Directory
cd repository-name
-
Run the Script
.\ScriptName.ps1
-
Follow the Prompts
- The script will check for administrator privileges and required modules, prompting you for actions as necessary.
- Enter the email address or label for the export when prompted.
- Respond to any additional prompts to retrieve information for another account or to handle exceptions.
The script will generate a CSV file named {Email}_MFAStatusReport.csv
in the export
directory within the script’s location. The report contains details such as UserPrincipalName, DisplayName, MFAStatus, PreferredMFA, PhoneNumber, MainEmailAddress, and EmailAliases.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/NewFeature
) - Commit your Changes (
git commit -m 'Add some NewFeature'
) - Push to the Branch (
git push origin feature/NewFeature
) - Open a Pull Request
Distributed under the License. See LICENSE for more information.