Initial Log in:

$cred=get-credential
$session = new-pssession -Configurationname microsoft.exchange -connectionuri https://ps.outlook.com/powershell -credential $cred -authentication basic -allowredirection
import-pssession $session

connect-msolservice -credential $cred

Logout

Remove-PSSession $Session

Calendar:

Add calendar permission:  Add-MailboxFolderPermission -Identity user1@domain.com:\calendar -user user2@domain.com -AccessRights Editor

Display calendar permission: Get-MailboxFolderPermission -Identity calendar@mydomain.com.au:\Calendar -User user@mydomain.com.au

Check a calendar’s permissions: Get-MailboxFolderPermission user@mydomain.com.au:\calendar

Remove Calendar permission:  Remove-MailboxFolderPermission user1@mydomain.com.au:\calendar -User user2@mydomain.com.au

Set default calendar of userA:
Set-MailboxFolderPermission -Identity UserA:\calendar -User default -AccessRights Reviewer -confirm:$true
Set-MailBoxFolderPermission UserA@mydomain.com.au:\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 user@domain.com -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 mydomain.com –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 user@userdomain.com | set-mailbox -type “Shared”

Remove license from user:  Set-MsolUserLicense -UserPrincipalName user@domain.com -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 yourname1@yourdomain.com -User yourname2@yourdomain.com -AccessRights FullAccess -InheritanceType All

Grand send as permission to mailbox: Add-RecipientPermission <Identity> -AccessRights SendAs -Trustee <Identity> Eg. Add-RecipientPermission yourname1@mydomain.com -AccessRights SendAs -Trustee yourname2@mydomain.com

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 myname@mydomain.com -PasswordNeverExpires $True 

Set password for a user: Set-MsolUserPassword -UserPrincipalName myname@mydomain.com -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 https://autodiscover-s.outlook.com/Autodiscover/Autodiscover.
xml

 

Tagged:

Leave a Reply

Your email address will not be published.


*