From 1ffd38db7ca4c3153614d9e1ea614fe142bdfebe Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Tue, 23 Jan 2024 20:20:22 -0700 Subject: [PATCH] Add Scripts/Powershell/Azure/Connect to Azure AD.md --- .../Powershell/Azure/Connect to Azure AD.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Scripts/Powershell/Azure/Connect to Azure AD.md diff --git a/Scripts/Powershell/Azure/Connect to Azure AD.md b/Scripts/Powershell/Azure/Connect to Azure AD.md new file mode 100644 index 0000000..07ce7c5 --- /dev/null +++ b/Scripts/Powershell/Azure/Connect to Azure AD.md @@ -0,0 +1,26 @@ +**Purpose**: Sometimes you will need to connect to Azure AD via powershell in order to perform troubleshooting / automation. + +## Update Nuget Package Manager +``` powershell +Install-PackageProvider -Name NuGet -Force -ForceBootstrap +``` + +## Install AzureAD Powershell Modules +You will need to install the modules for AzureAD before you can run the commands necessary for querying Azure. +``` powershell +Install-Module -Name AzureAD +``` + +## Connect to AzureAD +When you run the following command, it will open a dialog box to take the username, password, and MFA code (if applicable) for an administrative account in the Azure Active Directory. +``` powershell +Connect-AzureAD +``` + +### Useful commands +The following are quick references for different fields in AzureAD. + +Check Email Aliases: +``` powershell +Get-AzureADUser -ObjectId "user@domain.com" | Select -Property ProxyAddresses +``` \ No newline at end of file