Microsoft Azure Powershell Mac
Microsoft Azure portal Build, manage, and monitor all Azure products in a single, unified console; Cloud Shell Streamline Azure administration with a browser-based shell; Azure mobile app Stay connected to your Azure resources—anytime, anywhere; Azure Backup Simplify data protection and protect against ransomware.
-->- Nov 16, 2018 The AzureRM module is a rollup module for the Azure PowerShell cmdlets. Installing it downloads all of the available Azure Resource Manager modules, and makes their cmdlets available for use. To start working with Azure PowerShell, sign in with your Azure credentials.
- Hyper-V by default uses dynamic MAC address – which means that Hyper-V will generate an initial MAC address for each network adapter, either for VM (vmNIC) or for the host (vNIC), and it will regenerate the MAC address if it believes it is necessary.
Office 365 PowerShell lets you manage your Office 365 settings from the command line. Connecting to Office 365 PowerShell is a simple process where you install the required software and then connect to your Office 365 organization.
There are two versions of the PowerShell module that you use to connect to Office 365 and administer user accounts, groups, and licenses:
- Azure Active Directory PowerShell for Graph (cmdlets include AzureAD in their name)
- Microsoft Azure Active Directory Module for Windows PowerShell (cmdlets include MSol in their name)
As of the date of this article, the Azure Active Directory PowerShell for Graph module does not completely replace the functionality in the cmdlets of Microsoft Azure Active Directory Module for Windows PowerShell module for user, group, and license administration. In many cases, you need to use both versions. You can safely install both versions on the same computer.
What do you need to know before you begin?
You can use the following versions of Windows:
Windows 10, Windows 8.1, Windows 8, or Windows 7 Service Pack 1 (SP1)
Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2 SP1
Note
For the Azure Active Directory PowerShell for Graph module, you must use PowerShell version 5.1 or later. For the Microsoft Azure Active Directory Module for Windows PowerShell module, you must use PowerShell version 5.1 or later up to PowerShell version 6. You cannot use PowerShell version 7. For Windows 8.1, Windows 8, Windows 7 Service Pack 1 (SP1), Windows Server 2012 R2, Windows Server 2012, and Windows Server 2008 R2 SP1, download and install the Windows Management Framework 5.1.
Note
Use a 64-bit version of Windows. Support for the 32-bit version the Microsoft Azure Active Directory Module for Windows PowerShell was discontinued in October of 2014.
These procedures are intended for users who are members of an Office 365 admin role. For more information, see About Office 365 admin roles.
Connect with the Azure Active Directory PowerShell for Graph module
Commands in the Azure Active Directory PowerShell for Graph module have AzureAD in their cmdlet name. You can install the Azure Active Directory PowerShell for Graph module or Azure PowerShell.
For procedures that require the new cmdlets in the Azure Active Directory PowerShell for Graph module, use these steps to install the module and connect to your Office 365 subscription.
Note
See Azure Active Directory PowerShell for Graph module for information about the support for different versions of Microsoft Windows.
Step 1: Install required software
These steps are required once on your computer, not every time you connect. However, you'll likely need to install newer versions of the software periodically.
Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).
In the Administrator: Windows PowerShell command window, run this command:
If prompted about installing a module from an untrusted repository, type Y and press ENTER.
Step 2: Connect to Azure AD for your Office 365 subscription
To connect to Azure AD for your Office 365 subscription with an account name and password or with multi-factor authentication (MFA), run one of these commands from a Windows PowerShell command prompt (it does not have to be elevated).
Office 365 cloud | Command |
Office 365 Worldwide (+GCC) | Connect-AzureAD |
Office 365 operated by 21 Vianet | Connect-AzureAD -AzureEnvironmentName AzureChinaCloud |
Office 365 Germany | Connect-AzureAD -AzureEnvironmentName AzureGermanyCloud |
Office 365 U.S. Government DoD and Office 365 U.S. Government GCC High | Connect-AzureAD -AzureEnvironmentName AzureUSGovernment |
In the Sign into your account dialog box, type your Office 365 work or school account user name and password, and then click OK.
If you are using MFA, follow the instructions in the additional dialog boxes to provide more authentication information, such as a verification code.
After connecting, you can use the cmdlets for the Azure Active Directory PowerShell for Graph module.
Connect with the Microsoft Azure Active Directory Module for Windows PowerShell
Commands in the Microsoft Azure Active Directory Module for Windows PowerShell have Msol in their cmdlet name.
PowerShell version 7 and later do not support the Microsoft Azure Active Directory Module for Windows PowerShell module and cmdlets with Msol in their name. For PowerShell version 7 and later, you must use the Azure Active Directory PowerShell for Graph module or Azure PowerShell.
PowerShell Core does not support the Microsoft Azure Active Directory Module for Windows PowerShell module and cmdlets with Msol in their name. To continue using these cmdlets, you must run them from Windows PowerShell.
Step 1: Install required software
These steps are required once on your computer, not every time you connect. However, you'll likely need to install newer versions of the software periodically.
Install the 64-bit version of the Microsoft Online Services Sign-in Assistant: Microsoft Online Services Sign-in Assistant for IT Professionals RTW.
Install the Microsoft Azure Active Directory Module for Windows PowerShell with these steps:
- Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).
- Run the Install-Module MSOnline command.
- If prompted to install the NuGet provider, type Y and press ENTER.
- If prompted to install the module from PSGallery, type Y and press ENTER.
Step 2: Connect to Azure AD for your Office 365 subscription
To connect to Azure AD for your Office 365 subscription with an account name and password or with multi-factor authentication (MFA), run one of these commands from a Windows PowerShell command prompt (it does not have to be elevated).
Office 365 cloud | Command |
Office 365 Worldwide (+GCC) | Connect-MsolService |
Office 365 operated by 21 Vianet | Connect-MsolService -AzureEnvironment AzureChinaCloud |
Office 365 Germany | Connect-MsolService -AzureEnvironment AzureGermanyCloud |
Office 365 U.S. Government DoD and Office 365 U.S. Government GCC High | Connect-MsolService -AzureEnvironment USGovernment |
In the Sign into your account dialog box, type your Office 365 work or school account user name and password, and then click OK.
If you are using MFA, follow the instructions in the additional dialog boxes to provide more authentication information, such as a verification code.
How do you know this worked?
If you don't receive any errors, you connected successfully. A quick test is to run an Office 365 cmdlet—for example, Get-MsolUser —and see the results.
If you receive errors, check the following requirements:
A common problem is an incorrect password. Run Step 2 again. and pay close attention to the user name and password you enter.
The Microsoft Azure Active Directory Module for Windows PowerShell requires that the Microsoft .NET Framework 3.5.x feature is enabled on your computer. It's likely that your computer has a newer version installed (for example, 4 or 4.5.x), but backwards compatibility with older versions of the .NET Framework can be enabled or disabled. For more information, see the following topics:
For Windows Server 2012 or Windows Server 2012 R2, see Enable .NET Framework 3.5 by using the Add Roles and Features Wizard
For Windows 7 or Windows Server 2008 R2, see You can't open the Azure Active Directory Module for Windows PowerShell
Frozen movie. Mac Microsoft Office frozen? What to do if such situation happens regularly? Learn how to fix Microsoft Word, Excel, and Outlook crashing on Apple computers. 2019-6-26 The Mac forums are filled with questions like “why does Microsoft word keep freezing on my Mac”. Even though Mac OS X is a reliable OS, but this doesn’t make it glitch free. Users often have to face a situation like this when Microsoft Word, Excel, Outlook, PowerPoint,.
For Windows 10, Windows 8.1, and Windows 8, see Install the .NET Framework 3.5 on Windows 10, Windows 8.1, and Windows 8
Your version of the Microsoft Azure Active Directory Module for Windows PowerShell might be out of date. To check, run the following command in Office 365 PowerShell or the Microsoft Azure Active Directory Module for Windows PowerShell:
If the version number returned is lower than the value 1.0.8070.2, uninstall the Microsoft Azure Active Directory Module for Windows PowerShell and install the latest version from the link in Step 1.
If you receive a connection error, see this topic:'Connect-MsolService: Exception of type was thrown' error.
If you receive a 'Get-Item : Cannot find path' error, use this command:
See also
-->For the macOS platform, you can install the Azure CLI with homebrew package manager. Homebrew makes it easy to keep yourinstallation of the CLI update to date. The CLI package has been tested on macOS versions 10.9 and later.
The current version of the Azure CLI is 2.3.1. For information about the latest release, see the release notes. To find your installed version and see if you need to update, run az --version
.
Install with Homebrew
Homebrew is the easiest way to manage your CLI install. It provides convenient ways to install, update, and uninstall.If you don't have homebrew available on your system, install homebrew before continuing.
You can install the CLI by updating your brew repository information, and then running the install
command:
Important
The Azure CLI has a dependency on the Homebrew python3
package, and will install it.The Azure CLI is guaranteed to be compatible with the latest version of python3
published on Homebrew.
You can then run the Azure CLI with the az
command. To sign in, use az login command.
Run the
login
command.If the CLI can open your default browser, it will do so and load an Azure sign-in page.
Otherwise, open a browser page at https://aka.ms/devicelogin and enter theauthorization code displayed in your terminal.
Sign in with your account credentials in the browser.
To learn more about different authentication methods, see Sign in with Azure CLI.
Troubleshooting
Microsoft Azure Powershell Commands
If you encounter a problem when installing the CLI through Homebrew, here are some common errors. If you experience a problem not covered here, file an issue on github.
Completion is not working
The Homebrew formula of Azure CLI installs a completion file named az
in the Homebrew-managed completions directory (default location is /usr/local/etc/bash_completion.d/
). To enable completion, please follow Homebrew's instructions here.
Unable to find Python or installed packages
There may be a minor version mismatch or other issue during homebrew installation. The CLI doesn't use a Python virtual environment, so it relies on findingthe installed Python version. A possible fix is to install and relink the python3
dependency from Homebrew.
CLI version 1.x is installed
If an out-of-date version was installed, it could be because of a stale homebrew cache. Follow the update instructions.
Proxy blocks connection
You may be unable to get resources from Homebrew unless you have correctly configured it touse your proxy. Follow the Homebrew proxy configuration instructions.
Important
If you are behind a proxy, HTTP_PROXY
and HTTPS_PROXY
must be set to connect to Azure services with the CLI.If you are not using basic auth, it's recommended to export these variables in your .bashrc
file.Always follow your business' security policies and the requirements of your system administrator.
In order to get the bottle resources from Homebrew, your proxy needs to allow HTTPS connections tothe following addresses:
https://formulae.brew.sh
https://homebrew.bintray.com
Update
The CLI is regularly updated with bug fixes, improvements, new features, and preview functionality. A new release is available roughly everytwo weeks. Update your local repository information and then upgrade the azure-cli
package.
Uninstall
If you decide to uninstall the Azure CLI, we're sorry to see you go. Before you uninstall, use the az feedback
command to let us knowwhat could be improved or fixed. Our goal is to make the Azure CLI bug-free and user-friendly. If you found a bug, we'd appreciate it if you file a GitHub issue.
Use homebrew to uninstall the azure-cli
package.
Other installation methods
If you can't use homebrew to install the Azure CLI in your environment, it's possible to use the manual instructions for Linux. Note thatthis process is not officially maintained to be compatible with macOS. Using a package manager such as Homebrew is always recommended. Only use the manualinstallation method if you have no other option available.
For the manual installation instructions, see Install Azure CLI on Linux manually.
Microsoft Azure Powershell Macbook
Next Steps
Install Azure Powershell Mac
Now that you've installed the Azure CLI, take a short tour of its features and common commands.