< Back

Move-MgaMailFolder

Sat Jan 18, 2020 4:41 pm

NAME Move-MgaMailFolder



SYNOPSIS

Move folder(s) to another folder





SYNTAX

Move-MgaMailFolder [-Folder] <FolderParameter[]> [-DestinationFolder] <FolderParameter> [-User <String>] [-Token

<AzureAccessToken>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Move folder(s) to another folder in Exchange Online using the graph api.





PARAMETERS

-Folder <FolderParameter[]>

Carrier object for Pipeline input. Accepts folders and strings.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-DestinationFolder <FolderParameter>

The destination folder where to move the folder to.



Tab completion is available on this parameter for a list of well known folders.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-User <String>

The user-account to access. Defaults to the main user connected as.

Can be any primary email name of any user the connected token has access to.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Token <AzureAccessToken>

The token representing an established connection to the Microsoft Graph Api.

Can be created by using New-MgaAccessToken.

Can be omitted if a connection has been registered using the -Register parameter on New-MgaAccessToken.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Outputs the token to the console



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

If this switch is enabled, no actions are performed but informational folders will be displayed that explain

what would happen if the command were to run.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If this switch is enabled, you will be prompted for confirmation before executing any operations that change

state.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

MSGraph.Exchange.Mail.Folder





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Move-MgaMailFolder -Folder $folder -DestinationFolder $destinationFolder



Moves the folder(s) in variable $folder to the folder in the variable $destinationFolder.

also possible:

PS C:\\> $folder | Move-MgaMailFolder -DestinationFolder $destinationFolder



The variable $folder can be represent:

PS C:\\> $folder = Get-MgaMailFolder -Name "MyFolder"



The variable $destinationFolder can be represent:

PS C:\\> $destinationFolder = Get-MgaMailFolder -Name "Archive"









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Move-MgaMailFolder -Id $folder.id -DestinationFolder $destinationFolder.id



Moves folders into the folder $destinationFolder.



The variable $folder can be represent:

PS C:\\> $folder = Get-MgaMailFolder -Name "MyFolder"



The variable $destinationFolder can be represent:

PS C:\\> $destinationFolder = Get-MgaMailFolder -Name "Archive"











RELATED LINKS