To connect to Azure AD using the MSOL module use the following commands:
- # Install the MSOnline module if this is first use.
- Install-Module MSOnline.
- # Add the MSOnline module to the PowerShell session.
- Import-Module MSOnline.
- # Get credentials of Azure admin.
- $Credentials = Get-Credential.
- # Connect to Azure AD.
From the taskbar, in the search text field, type powershell. Then, click or tap the 'Windows PowerShell' result. To run PowerShell as administrator, right-click (touchscreen users: tap and hold) on the Windows PowerShell search result, then click or tap 'Run as administrator'.
Connect to a remote Exchange server
- On your local computer, open Windows PowerShell, and run the following command: PowerShell Copy. $UserCredential = Get-Credential.
- Run the following command: PowerShell Copy. Import-PSSession $Session -DisableNameChecking.
The version of PowerShell is tucked away under a value in the registry key path HKLM:SOFTWAREMicrosoftPowerShell3PowerShellEngine . This registry key has a value called PowerShellVersion that you can reference by using Get-ItemProperty .
How to Create a Office 365 Group using PowerShell?
- Expand Groups and Click on Groups in the left navigation.
- Click on "Add a Group" >> Select "Office 365" under Type.
- Provide a name for the group and unique email address for the group.
- Click on "Select Owner" button and choose the owner to manage the group.
- Click on "Add" to start creating the Office 365 group.
Step1: Install Exchange Online
PowerShell Module for
MFA(One time process)
Step2: Connect Exchange Online PowerShell Using MFA
- Connect-EXOPSSession used to connect to Exchange Online with MFA.
- Connect-EXOPSSession has a parameter UserPrincipalName.
- Enter the password in the sign-in window and then click Sign in.
Click Start, click All Programs, click Accessories, click Windows PowerShell, and then click Windows PowerShell. If the returned Version number is 5.1, then you are running Windows PowerShell 5.1. If the returned Version number is not 5.1, then you'll need to install Windows PowerShell 5.1.
To determine the Office subscription license type, open an open an Office app (such as PowerPoint), select the name of the app in the menu, and then About (app). The license type will be listed below the Product ID.
Using the Microsoft 365 admin centerUse the Microsoft 365 admin center to assign licenses to individual users or small sets of users at a time. You can assign licenses on the Licenses page (for up to 20 users at a time) or the Active users page.
Microsoft allows Office 365 accounts to be set up without a license at no charge. Use unlicensed accounts for global admin access. Once the global admin accounts are set up, log in as a global admin and remove global admin permissions from all other users.
Sign in to manage Office
- Go to www.office.com and if you're not already signed in, sign in with your personal Microsoft account, or work or school account when prompted.
- From the upper-right corner select your account name, and then select View account from the list of options.
Common License Types Overview
| License Type | Target | Pricing |
|---|
| Office 365 E1* | Enterprise | $8 user/month (annual commitment) |
| Office 365 E3* | Enterprise | $20 user/month (annual commitment) |
| Office 365 E5* | Enterprise | $35 user/month (annual commitment) |
| Microsoft 365 F3 (formerly F1) | Enterprise | $10 user/month (annual commitment) |
- Step 1: Open the Office program. Programs such as Word and Excel are pre-installed on a laptop with a year of free Office.
- Step 2: choose an account. An activation screen will appear.
- Step 3: Log in to Microsoft 365.
- Step 4: accept the conditions.
- Step 5: get started.
To assign Office 365 license to Guest User you could follow below steps.
- Create a group on azure active directory.
- Add your guest user to that group.
- Now assign licence to that group.
On the device where you want to change the key, open any Office app, select the File menu and then select Account near the bottom of the menu. Under Product Information, select the Change License button.
Use the Azure Active Directory PowerShell for Graph moduleFirst, connect to your Microsoft 365 tenant. To list all of the users in your subscription, use the Get-AzureAdUser -All $true command.
Step 1: Install the required software
- Open an elevated Windows PowerShell Command Prompt window (run Windows PowerShell as an administrator).
- Run this command: PowerShell Copy. Install-Module -Name AzureAD. If you're prompted to install a module from an untrusted repository, type Y and press Enter.
What's the purpose of UsageLocation? Is it same as of Country field populated in Active Directory? If you look at a cloud user via PowerShell, you'll also notice that there is a separate “UsageLocation” attribute. This attribute is the one used while assigning a license to a user in office 365.
How to bulk assign Office 365 licenses from CSV file
- Log on to a machine that has 'Microsoft Online Services Module for Windows PowerShell' installed. You can install this on your own workstation but it should also be installed on your ADFS Servers.
- Create a new text file.
- Open c: empuserlist.csv in Notepad.
- Populate userlist.csv.
To assign a license to a user
- On the Products page, select the name of the license plan you want to assign to the user.
- On the license plan overview page, select Assign.
- On the Assign page, select Users and groups, and then search for and select the user you're assigning the license.
Click users and groups, and then click active users. ), and then in the drop-down box, click Unlicensed users. NoteTo assign a license to a user, double-click the user. On the "Assign licenses" page, click to select the check boxes next to the items that you want to assign, and then click save.
?Add-ADGroupMember?Add-MsolRoleMember?Set-MsolUser?Add-MsolRole ?When creating a new user in Microsoft Azure, how is the initial password determined? ?The default password is always Pa$$w0rd.
MCOMEETADV – Audio Conferencing (formerly PSTN Conferencing) MCOEV – Phone System (formerly Cloud PBX) MCOPSTN1 – Domestic Calling Plan. MCOPSTN2 – International Calling Plan.
To connect to SharePoint Online, use the Connect-SPOService command. It takes the URL to your tenant admin and a username. As soon as you connect, you'll be asked for your password. If you connect successfully, it will return to the command prompt without error.
To manage sites in the new SharePoint admin center, go to the current SharePoint admin center, click "Try it now" in the upper right and select Active sites. Click Create. Select to create a communication site or a team site (which will create an Office 365 group) or a communication site.
The root site URL for SharePoint Online is provisioned based off your input when setting up your Office 365 subscription. For example, if your organization name is Contoso, the root site for SharePoint Online will be sharepoint.com .
For official Microsoft content, see Microsoft 365 documentation. PowerShell is an automation scripting language from Microsoft, which was originally only available on Windows devices, and built on top of the . NET Framework.
The SharePoint Online Management Shell is a Windows PowerShell module that you can use to manage SharePoint settings at the organization level and site collection level. Command-line operations in Windows PowerShell are composed of a series of commands.
There are two Power Shell tool Windows PowerShell and SharePoint Online Management Shell available and we will use Windows PowerShell.
- Open Windows PowerShell.
- Insert your SharePoint login credentials.
- It will return Client Side Object Model context details with SharePoint Version.
To open the SharePoint Online Management Shell command prompt, from the Start screen, type sharepoint, and then click SharePoint Online Management Shell.
SharePoint Online - How To Install SharePoint Online Management Shell
- System requirement.
- Supported operating system.
- PowerShell.
- Visit the URL
- Click Download button.
- Run sharepointonlinemanagementshell_4727-1200_x64_en-us.
- Accept License Terms & click Install button.
How can I easily execute a PowerShell script?
- Browse to the location you stored the ps1-file in File Explorer and choose; File-> Open Windows PowerShell.
- Type (part of) the name of the script.
- Press TAB to autocomplete then name. Note: Do this even when you typed the name in full.
- Press ENTER to execute the script.