This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-OwaMailboxPolicy | FL name,SetPhotoEnabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install-Module ExchangeOnlineManagement | |
| Import-Module ExchangeOnlineManagement | |
| Connect-ExchangeOnline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $f.items | foreach{ | |
| $_.attachments|foreach{ | |
| Write-Host $_ | |
| $_.saveasfile((Join-Path $localpath $_.filename)) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $f = $namespace.PickFolder() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $localpath = "C:\temp\" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add assembly and create object to access Outlook | |
| Add-type -assembly "Microsoft.Office.Interop.Outlook" | |
| $olDefaultFolders = "Microsoft.Office.Interop.Outlook.olDefaultFolders" -as [type] | |
| $outlook = New-Object -comobject Outlook.Application | |
| # Create namespace and get folders | |
| $namespace = $outlook.GetNameSpace("MAPI") | |
| $folders = $namespace.getDefaultFolder($olDefaultFolders::olFolderInBox) | |
| # tests to see im connections work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $namespace.CurrentUser # get the current user | |
| $folders.items # shows all mails | |
| $folders.folders # shows folders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $namespace = $outlook.GetNameSpace("MAPI") | |
| $folders = $namespace.getDefaultFolder($olDefaultFolders::olFolderInBox) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $olDefaultFolders = "Microsoft.Office.Interop.Outlook.olDefaultFolders" -as [type] | |
| $outlook = New-Object -comobject Outlook.Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add-Type -assembly "Microsoft.Office.Interop.Outlook" |