{"id":13599138,"url":"https://github.com/kevinblumenfeld/Posh365","last_synced_at":"2025-04-10T12:31:39.323Z","repository":{"id":36458355,"uuid":"110848487","full_name":"kevinblumenfeld/Posh365","owner":"kevinblumenfeld","description":"Connect. Provision. Maintain.","archived":false,"fork":false,"pushed_at":"2022-04-16T13:19:41.000Z","size":3666,"stargazers_count":57,"open_issues_count":13,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-02T17:36:10.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevinblumenfeld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-15T15:06:51.000Z","updated_at":"2024-03-29T06:15:47.000Z","dependencies_parsed_at":"2022-08-08T15:00:50.917Z","dependency_job_id":null,"html_url":"https://github.com/kevinblumenfeld/Posh365","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinblumenfeld%2FPosh365","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinblumenfeld%2FPosh365/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinblumenfeld%2FPosh365/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinblumenfeld%2FPosh365/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinblumenfeld","download_url":"https://codeload.github.com/kevinblumenfeld/Posh365/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223437336,"owners_count":17144901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T17:01:00.104Z","updated_at":"2024-11-07T00:30:51.135Z","avatar_url":"https://github.com/kevinblumenfeld.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"\n# Posh365\n\n  [![](https://img.shields.io/powershellgallery/v/Posh365.svg)](https://www.powershellgallery.com/packages/Posh365) [![](https://img.shields.io/powershellgallery/dt/Posh365.svg)](https://www.powershellgallery.com/packages/Posh365)\n\n###### Install\n```powershell\nSet-ExecutionPolicy RemoteSigned\n[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12\nInstall-Module Posh365 -Force\n```\n\n###### Install without Admin Access\n```powershell\nSet-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force\n[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12\nInstall-Module Posh365 -Force -Scope CurrentUser\n```\n\n###### Update Posh365\n```powershell\n[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12\nInstall-Module Posh365 -Force\nImport-Module Posh365 -Force\n```\n### `Connect`\n\n**Connect-Cloud** Connect to one or more services: Az, AzureAD, Compliance, Exo2, MSOnline, SharePoint \u0026 Teams.  Credentials are locally encrypted for reuse - no need to reenter credentials the next time you need to connect.\n\n```powershell\nConnect-Cloud -Tenant Contoso -EXO2 -MSOnline -AzureAD\nConnect-Cloud -Tenant Contoso -EXO2 -MSOnline -AzureAD -GCCHIGH\nConnect-Cloud -Tenant Contoso -EXO2 -MFA #when using MFA\nConnect-Cloud -Tenant Contoso -Teams\nConnect-Cloud -Tenant Contoso -Teams -GCCHIGH\nConnect-Cloud -Tenant Contoso -AZ\nConnect-Cloud -Tenant Contoso -AZ -GCCHIGH\nConnect-Cloud -Tenant Contoso -SharePoint\nConnect-Cloud -Tenant Contoso -Compliance\nConnect-Cloud -Tenant Contoso -DeleteCreds #Deletes locally encrypted creds only\n```\n\n**New-ExoCBAConnection** Create reusable Exchange Online Certificate Based Authentication (CBA) connections\n\n```powershell\nNew-ExoCBAConnection -Tenant Contoso\nConnect-Cloud -Tenant Contoso -EXOCBA\n```\n![Exchange_Online_Certificate_Based_Authentication_Function](https://user-images.githubusercontent.com/28877715/112916577-d5d37580-90ce-11eb-9f8a-698199c28f95.gif)\n\n**Connect-CloudMFA** Same as Connect-Cloud but includes built-in password manager GUI\n\n```powershell\nConnect-CloudMFA -Tenant Contoso -EXO2 -MSOnline -AzureAD -Teams\n```\n**Connect-Exchange** Connect to Exchange on-premises\n```powershell\nConnect-Exchange -Server EXHybrid #Encrypts and reuses creds locally\nConnect-Exchange -Server EXHybrid -DontViewEntireForest\nConnect-Exchange -Server EXHybrid -DeleteExchangeCreds #Deletes locally encrypted creds only\n```\n**Export-GraphConfig** Use a GUI to save/encrypt ClientID, TenantID, Secret, UserName \u0026 Password\n**Connect-PoshGraph** Use saved encrypted credentials to connnect to Graph and Azure APIs\n```powershell\nExport-GraphConfig -Tenant Contoso\nConnect-PoshGraph -Tenant Contoso\n```\n\n### `Discover Office 365`\n```powershell\nGet-DiscoveryOffice365 -Tenant Contoso -Verbose\n```\n**Choose** all items \u0026 click OK\n**Choose** Connection type \u0026 click OK\n\n\u003e\u003csub\u003e**First time running this?** Let's install PowerShellGet2:\u003c/sub\u003e\n\n\u003csub\u003e1. Run: Connect-Cloud -Tenant Contoso -EXO2\u003c/sub\u003e\n\u003csub\u003e2. Sign in as Global Admin \u0026 restart powershell when prompted\u003c/sub\u003e\n\u003csub\u003e3. Run: Get-DiscoveryOffice365 -Tenant Contoso -Verbose\u003c/sub\u003e\n\n### `Discover On-Premises`\n\u003e \u003csub\u003eRequires RSAT\u003c/sub\u003e\n```powershell\nGet-DiscoveryOnPrem -Verbose\n```\n\u003csub\u003e1. Run: Get-Discovery -Verbose\u003c/sub\u003e\n\u003csub\u003e2. Enter name of Exchange Server when prompted\u003c/sub\u003e\n\u003csub\u003e3. Click link for Batches, copy/paste code on-premises\u003c/sub\u003e\n\u003csub\u003e4. Click link for Permissions, copy/paste code on-premises\u003c/sub\u003e\n\u003csub\u003e5. Add both documents to the root of SharePoint \u003e Documents\u003c/sub\u003e\n\u003csub\u003e6. Add BATCH01 to BatchName column in Batches.xlsx for pilot\u003c/sub\u003e\n\n\n| Document to add to SharePoint | Paste code on-premises (not EMS) |\n| :---------------------------: | :------------------------------: |\n| Batches.xlsx | https://bit.ly/corebatches |\n| Permissions.xlsx | http://bit.ly/PermissionsScaled |\n\n\n### `Migrate from Hybrid to Office 365`\n\u003e \u003csub\u003e**Note**: Each command presents a GUI for selection and confirmation\u003c/sub\u003e\n\u003e \u003csub\u003e**Connect to Exchange Online.** Connect-Cloud -Tenant Contoso -EXO2\u003c/sub\u003e\n#### `Analyze Permissions`\n**Update-MailboxMovePermissionBatch** GUI to analyze permissions of mailboxes from Batches.xlsx. Will output new Batches.xlsx to desktop. Can add to SharePoint as new Batches file.\n```powershell\n$params = @{\n    SharePointURL = 'https://contoso.sharepoint.com/sites/migrate'\n    ExcelFile     = 'Batches.xlsx'\n}\nUpdate-MailboxMovePermissionBatch @params\n```\n\n#### `Migrate`\n\n**Test-MailboxMove** Test migration readiness of the mailboxes from Batches.xlsx. Of each user to be migrated, reports PASS or FAIL overall and individual on the following tests:\n* Verifies each smtp address domain is an accepted domain\n* Verifies mail user exists in Exchange Online\n* Verifies mailbox does not exist in Exchange Online\n* Verifies mail user is DirSynced\n* Verifies UserMailboxes accounts are not disabled\n* Verifies Routing Address is valid\n* Verifies UserPrincipalName matches PrimarySmtpAddress (Use -SkipUpnMatchSmtpTest to skip this test)\n\n```powershell\n$params = @{\n    SharePointURL = 'https://contoso.sharepoint.com/sites/migrate'\n    ExcelFile     = 'Batches.xlsx'\n}\nTest-MailboxMove @params\n```\n**New-MailboxMove** Creates new move requests. Example uses batches file in SP site named \"migrate\". Use links in Discovery On-Premises to create Batches and Permissions files [[ Link ]](https://github.com/kevinblumenfeld/Posh365#discover-on-premises)\n```powershell\n$params = @{\n    SharePointURL = 'https://contoso.sharepoint.com/sites/migrate'\n    ExcelFile     = 'Batches.xlsx'\n    RemoteHost    = 'hybrid.contoso.com'\n    Tenant        = 'contoso'\n}\nNew-MailboxMove @params\n```\n```powershell\n# For GCC/GCCHIGH tenants: use full tenant address as shown below:\n$params = @{\n    SharePointURL = 'https://contoso.sharepoint.com/sites/migrate'\n    ExcelFile     = 'Batches.xlsx'\n    RemoteHost    = 'hybrid.contoso.com'\n    Tenant        = 'contoso.mail.onmicrosoft.us'\n}\nNew-MailboxMove @params\n```\n\n**Set-MailboxMove** Set move requests\n\n```powershell\nSet-MailboxMove -BadItemLimit 300 -LargeItemLimit 400\n```\n\n**Suspend-MailboxMove** Suspends move requests\n\n```powershell\nSuspend-MailboxMove\n```\n**Resume-MailboxMove** Resumes move requests\n```powershell\nResume-MailboxMove\nResume-MailboxMove -DontAutoComplete\n```\n\n**Remove-MailboxMove** Removes move requests\n```powershell\nRemove-MailboxMove\n```\n**Complete-MailboxMove** Complete move requests\n```powershell\nComplete-MailboxMove\nComplete-MailboxMove -Schedule #GUI presented to pick time, date, and users\n```\n#### `Report on Migration`\n**Get-MailboxMoveStatistics** Gets move request statistics for any or all move requests. Multi-select or select all, click OK\n```powershell\nGet-MailboxMoveStatistics\nGet-MailboxMoveStatistics -IncludeCompleted\n```\n**Get-MailboxMoveReport** Gets full move request report - from present to past. The way it should be\n```powershell\nGet-MailboxMoveReport\n```\n\n#### `License`\n\n**Set-MailboxMoveLicense** GUI to license users via AzureAD\n\u003e \u003csub\u003e**Connect to AzureAD** Connect-Cloud -Tenant Contoso -AzureAD\u003c/sub\u003e\n```powershell\nSet-MailboxMoveLicense\nSet-MailboxMoveLicense -MailboxCSV .\\UserPrincipalName.csv\n\n$params = @{\n    SharePointURL = 'https://contoso.sharepoint.com/sites/migrate'\n    ExcelFile     = 'Batches.xlsx'\n }\nSet-MailboxMoveLicense @params\n```\n\n**Get-MailboxMoveLicense** Reports on user license Skus via AzureAD\n```powershell\nGet-MailboxMoveLicense\nGet-MailboxMoveLicense -OneSkuPerLine\nGet-MailboxMoveLicense -OneSkuPerLine -ExportToExcel # file saved in Posh365 folder on desktop\nGet-MailboxMoveLicense -IncludeRecipientType # Connect to EXO2\n\n$params = @{\n    SharePointURL = 'https://contoso.sharepoint.com/sites/migrate'\n    ExcelFile     = 'Batches.xlsx'\n }\nGet-MailboxMoveLicense @params\n```\n**Get-MailboxMoveLicenseCount** Reports on a tenant's consumed and total skus and options\n```powershell\nGet-MailboxMoveLicenseCount\n```\n**Get-MailboxMoveLicenseReport** Reports on each user's assigned skus and options, csv and excel output\n```powershell\nGet-MailboxMoveLicenseReport -Path C:\\temp\\\n```\n### `Mail Flow`\n#### `Message Trace`\n\n**Trace-Message** GUI to trace Exchange Online messages. Select messages \u0026 click OK for trace details\n```powershell\nTrace-Message # all messages from past 15 minutes\nTrace-Message -StartSearchHoursAgo 6.3 -EndSearchHoursAgo 5 -Subject 'From the CEO'\nTrace-Message -StartSearchHoursAgo 10 -Sender jane@Contoso.com\nTrace-Message -Sender jane@Contoso.com -Recipient emily@Contoso.com\n```\n\n**Trace-ExchangeMessage** GUI to trace on-premises messages. Select messages \u0026 click OK for messageID details\n```powershell\nTrace-ExchangeMessage # all messages from past 15 minutes\nTrace-ExchangeMessage -StartSearchHoursAgo 10 -ExportToCsv\nTrace-ExchangeMessage -StartSearchHoursAgo 10 -ExportToExcel -SkipHealthMessages\n```\n### `Administration`\n#### `Managed Folder Assistant`\n**Get-MfaStats** Return Managed Folder Assistant statistics as an object. Switch to start the MFA too\n```powershell\n'jane@Contoso.com' | Get-MfaStats\n'jane@Contoso.com' | Get-MfaStats -StartMFA\n(Import-CSV .\\mailboxes.csv).UserPrincipalName | Get-MfaStats\n(Import-CSV .\\mailboxes.csv).UserPrincipalName | Get-MfaStats -StartMFA\n(Get-EXOMailbox -Properties Office -Filter \"Office -eq 'Redmond'\").UserPrincipalName | Get-MfaStats\n(Get-EXOMailbox -Properties Office -Filter \"Office -eq 'Redmond'\").UserPrincipalName | Get-MfaStats -StartMFA\n```\n### `Networking`\n#### `Office365 Endpoints`\n**Get-OfficeEndpoints** URLs and IPs, initial and \"changes since\", CSV and Excel output (click to enlarge)\n\n![ME3V6nNhwV](https://user-images.githubusercontent.com/28877715/71635906-fcb6a980-2bf6-11ea-927e-03c9bda8f2a4.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinblumenfeld%2FPosh365","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinblumenfeld%2FPosh365","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinblumenfeld%2FPosh365/lists"}