My Blog List

Wednesday, July 20, 2022

O365 Commands

 Install-Module MSOnline

Install-Module ExchangeOnlineManagement


#Connect to MS Online

Connect-MsolService

Get-MsolUser -UserPrincipalName affinity_dev@bankaust.com.au  | fl

Get-MsolUser -All | Where {$_.BlockCredential -eq $True} | Select DisplayName,UserPrincipalName,BlockCredential,IsLicensed | Export-Csv C:\temp\Blocked_0365.csv

Get-MsolUser -UserPrincipalName sahan.Jayarathna@bankaust.com.au | fl

Get License details of Azure AD User

Get-MsolUser -UserPrincipalName Alyssa.Roylance@bankaust.com.au | Select UserPrincipalName, Licenses

#get licnese based on user

Get-MsolUser -UserPrincipalName Aman.Nisar@bankaust.com.au | fl

#get all licenses in tenancy 

Get-MsolAccountSku


#get users with a license type

Get-MsolUser -All| Where-Object {($_.licenses).AccountSkuId -match "DYN365_ENTERPRISE_SALES"} | Select UserPrincipalName,DisplayName,BlockCredential | Export-Csv C:\Work\Projects\d365es.csv


#DYN365_ENTERPRISE_CUSTOMER_SERVICE - Dynamics 365 Customer Service Enterprise

#D365_CUSTOMER_SERVICE_ENT_ATTACH - Dynamics 365 Customer Service Enterprise Attach to Qualifying Dynamics 365 Base Offer

#DYN365_TEAM_MEMBERS  - Dynamics 365 Team Members

#DYN365_ENTERPRISE_SALES  - Dynamics 365 Sales Enterprise Edition

1. Connect to exchnage online

Import-Module ExchangeOnlineManagement

Connect-ExchangeOnline


2. Turn litigation hold on indefinitly

Set-Mailbox Sian.Sewell@bankaust.com.au -LitigationHoldEnabled $true


3. Get-MailboxFolderPermission -Identity WestEndStaff.AnnualLeave@bankaust.com.au:\calendar


4. Add-MailboxFolderPermission -Identity WestEndStaff.AnnualLeave@bankaust.com.au:\calendar -User Lisa.Heard@bankaust.com.au -AccessRights Editor


5. Convert mailboxes in .csv to shared mailboxes

Import-Csv C:\PS\O365\License2132022.csv |  foreach {Get-Mailbox -Identity $_.Email | Where-Object {$_.RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -Type Shared}


6. Verify that all the user mailbox is converted to type shared mailbox.

Import-Csv C:\PS\O365\License2132022.csv | foreach {Get-Mailbox -Identity $_.Email} | ft Name, RecipientTypeDetails

7. Check Dmarc config 

Get-DkimSigningConfig -Identity bankaust.com.au | Format-List

8. Test-ApplicationAccessPolicy -Identity svc_veeam@bankaust.onmicrosoft.com -AppId d1c08c34-bc6c-4f1d-b809-0b8c11868824


No comments:

Post a Comment

Steps to extract ntfs share details from file server shares

As part of a file server consolidation effort, I was tasked to come up with a method to move multiple shares on multiple shares to a WSFC. I...