Initial Log in:

$session = new-pssession -Configurationname -connectionuri -credential $cred -authentication basic -allowredirection
import-pssession $session

connect-msolservice -credential $cred


Remove-PSSession $Session


Add calendar permission:  Add-MailboxFolderPermission -Identity\calendar -user -AccessRights Editor

Display calendar permission: Get-MailboxFolderPermission -Identity\Calendar -User

Check a calendar’s permissions: Get-MailboxFolderPermission\calendar

Remove Calendar permission:  Remove-MailboxFolderPermission\calendar -User

Set default calendar of userA:
Set-MailboxFolderPermission -Identity UserA:\calendar -User default -AccessRights Reviewer -confirm:$true
Set-MailBoxFolderPermission\Calendar” –User default –AccessRights PublishingEditor


Set default calendar permission for all mailbox: Get-Mailbox | foreach{ Set-MailboxFolderPermission $($_.UserPrincipalName+”:\calendar”) -User default -AccessRights  Reviewer }

Set calendar permission to all calendar for a user:  Get-Mailbox | foreach{ Add-MailboxFolderPermission $($_.UserPrincipalName+”:\calendar”) -User -AccessRights  PublishingEditor}

Displays organization license information for office 365:  Get-MSOLAccountSKU | FL

Displays SKU ID:  Get-MsolAccountSKU 

Displays user list:  GetMSOLUser

Remove a domain name that doesn’t delete:  Remove-MsolDomain -domainname –force

Display licensed user:  Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” }

Display unlicensed user:  Get-MsolUser | where {-not $_.islicensed}

Change mailbox to shared mailbox:   get-mailbox -identity | set-mailbox -type “Shared”

Remove license from user:  Set-MsolUserLicense -UserPrincipalName -RemoveLicenses “syndication-account:LITEPACK_P2”
syndication-account:LITEPACK_P2 is for Small business premium plan. You can check your plan by typing Get-MsolAccountSKU cmdlet

Display all email addresses: Get-Mailbox | Select-Object DisplayName,@{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_ -LIKE “SMTP:*”}}} | Sort | Format-List

Grant Full access permission to mailbox: Add-MailboxPermission <Identity> -User <Identity> -AccessRights FullAccess -InheritanceType All   Eg. <Add-MailboxPermission -User -AccessRights FullAccess -InheritanceType All

Grand send as permission to mailbox: Add-RecipientPermission <Identity> -AccessRights SendAs -Trustee <Identity> Eg. Add-RecipientPermission -AccessRights SendAs -Trustee

Check password never expire status: Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

Set password never expire: Get-MsolUser | Set-MsolUser –PasswordNeverExpires $True

Set password never expire for a user: Set-MsolUser –UserPrincipalName -PasswordNeverExpires $True 

Set password for a user: Set-MsolUserPassword -UserPrincipalName -NewPassword mypassword -ForceChangePassword $False

Change autodiscovery to office365 in on premises exchange server

Get-ClientAccessServer |select Name, *internal* | FL
Set-ClientAccessServer -Identity SL-SBS01 -AutoDiscoverServiceInternalUri



Leave a Reply

Your email address will not be published.