Get-EAIO365Photos

Module: Exchange_AddIn
Applies to: Exchange online

This function is built to download photos from Exchange online. Primary use was for then to run the photos through an application to confirm the image was of a person and not other cartoon charactors or multiple people.

Get-EaiO365Photos

SYNOPSIS

Get and download photos from O365.

SYNTAX

Single User (Default)

Get-EaiO365Photos [-folderpath <Object>] [-Identity <String[]>] [<CommonParameters>]

Unlimited

Get-EaiO365Photos [-folderpath <Object>] [-Unlimited] [<CommonParameters>]

DESCRIPTION

Designed to download photos from all users in O365 or to get information about a single user.
This exports the images to a folder and lists out user objects with no photos.

EXAMPLES

EXAMPLE 1

Get-EaiO365Photos -unlimited

Downloads all photos from an O365 tenant and saves them into c:\Temp\Photo on the local machine by default.
If the folder does not exist, it will create it.
If users do not have photos, their alias is listed in 'UsersNoPhotos.csv' file in the defined path.

EXAMPLE 2

Get-EaiO365Photos -unlimited -path c:\Temp

Downloads all photos from an O365 tenant and saves them into c:\Temp on the local machine.
If the folder does not exist, it will create it.
If users do not have photos, their alias is listed in 'UsersNoPhotos.csv' file in the defined path.

EXAMPLE 3

Get-EaiO365Photos -unlimited -path \\someserver\someshare

Downloads photos from an O365 tenant and saves them into the UNC path of \\someserver\someshare remote location.
If the folder does not exist, it will attempt to create it.
If users do not have photos, their alias is listed in 'UsersNoPhotos.csv' file in the defined path.

EXAMPLE 4

Get-EaiO365Photos -identity mike@contoso.com

Download photo for user mike@contoso.com.
If the user does not have a photo, their alias is listed in 'UsersNoPhotos.csv' file in the defined path.

EXAMPLE 5

Get-EaiO365Photos -identity 'Mia@contoso.com', 'Tony@contoso.com'

Download photo information for users Mia@contoso.com and Tony@contoso.com and outputs any user(s) without a photo in 'UsersNoPhotos.csv' file in the defined path.

PARAMETERS

-folderpath

{{ Fill folderpath Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: C:\Temp\Photos\
Accept pipeline input: False
Accept wildcard characters: False

-Unlimited

Type: SwitchParameter
Parameter Sets: Unlimited
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Identity

Type: String[]
Parameter Sets: Single User
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Path to save files to.

OUTPUTS

Images in .jpg format and list of users without an image.

NOTES

Original code from:
Start-Process https://blog.jijitechnologies.com/how-to-download-office365-user-profile-photo
Updated to function and added error checking information for easier usage.
Updates assisted by: Tony Radkiewicz.

RELATED LINKS