Here are 50 of the most useful Office 365 PowerShell commands:
- Connect to Office 365: Connect-MsolService
- Create a new user: New-MsolUser
- Add a license to a user: Set-MsolUserLicense
- Remove a license from a user: Set-MsolUserLicense -RemoveLicense
- Add a user to a distribution group: Add-DistributionGroupMember
- Remove a user from a distribution group: Remove-DistributionGroupMember
- Add a user to a security group: Add-MsolGroupMember
- Remove a user from a security group: Remove-MsolGroupMember
- Add a user to a SharePoint group: Add-SPOUser
- Remove a user from a SharePoint group: Remove-SPOUser
- Create a new SharePoint site: New-SPOSite
- Remove a SharePoint site: Remove-SPOSite
- Set a SharePoint site's permissions: Set-SPOSite
- Set a user's password: Set-MsolUserPassword
- Reset a user's password: Reset-MsolUserPassword
- Assign a role to a user: Add-MsolRoleMember
- Remove a role from a user: Remove-MsolRoleMember
- View a user's roles: Get-MsolRoleMember
- Create a new group: New-MsolGroup
- Remove a group: Remove-MsolGroup
- Set a group's properties: Set-MsolGroup
- View a group's members: Get-MsolGroupMember
- View a user's properties: Get-MsolUser
- View a user's licenses: Get-MsolUserLicense
- View a user's groups: Get-MsolUser -UserPrincipalName "user@domain.com" | Select -ExpandProperty ProxyAddresses
- View a user's roles: Get-MsolUser -UserPrincipalName "user@domain.com" | Select -ExpandProperty Roles
- View a user's SharePoint sites: Get-SPOUser
- View a user's OneDrive for Business site: Get-SPOSite -Identity "https://domain-my.sharepoint.com/personal/user_domain_com"
- View a user's Exchange mailbox: Get-Mailbox
- View a user's Outlook rules: Get-InboxRule
- Set an Exchange mailbox's properties: Set-Mailbox
- Set an Outlook rule's properties: Set-InboxRule
- View a user's calendar: Get-MailboxFolderStatistics -Identity user@domain.com:\calendar
- View a user's contacts: Get-MailboxFolderStatistics -Identity user@domain.com:\contacts
- View a user's tasks: Get-MailboxFolderStatistics -Identity user@domain.com:\tasks
- Create a new mailbox: New-Mailbox
- Remove a mailbox: Remove-Mailbox
- View a distribution group's properties: Get-DistributionGroup
- Set a distribution group's properties: Set-DistributionGroup
- View a security group's properties: Get-MsolGroup
- Set a security group's properties: Set-MsolGroup
- View a SharePoint site's properties: Get-SPOSite
- Set a SharePoint site's properties: Set-SPOSite
- View a SharePoint list's properties: Get-SPOList
- View a SharePoint library's properties: Get-SPODocumentLibrary
- Create a new SharePoint list: New-SPOList
- Create a new SharePoint library: New-SPODocumentLibrary
- Remove a SharePoint list: Remove-SPOList
- Remove a SharePoint library: Remove-SPODocumentLibrary
- Configure email forwarding for the user mailbox using the following command: Set-Mailbox -Identity "<UserPrincipalName>" -ForwardingAddress "<ExternalEmailAddress>" -DeliverToMailboxAndForward $falseNote: Replace <UserPrincipalName> with the user's email address and <ExternalEmailAddress> with the email address where you want to forward the emails. Verify the forwarding address is set correctly using the following command: Get-Mailbox -Identity "<UserPrincipalName>" | select *forward*To disable email forwarding, use the following command:Set-Mailbox -Identity "<UserPrincipalName>" -ForwardingAddress $null -DeliverToMailboxAndForward $false
1 Comments
I like this for daily work administration task
ReplyDelete