Remove-MgUserMailFolder
Delete navigation property mailFolders for users
Syntax
Remove-MgUserMailFolder
-MailFolderId <String>
-UserId <String>
[-IfMatch <String>]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-MgUserMailFolder
-InputObject <IMailIdentity>
[-IfMatch <String>]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Delete navigation property mailFolders for users
Examples
Example 1: Using the Remove-MgUserMailFolder Cmdlet
Import-Module Microsoft.Graph.Mail
# A UPN can also be used as -UserId.
Remove-MgUserMailFolder -UserId $userId -MailFolderId $mailFolderId
This example shows how to use the Remove-MgUserMailFolder Cmdlet. To learn about permissions for this resource, see the permissions reference.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IfMatch
ETag
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Identity Parameter To construct, please use Get-Help -Online and see NOTES section for INPUTOBJECT properties and create a hash table.
Type: | IMailIdentity |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MailFolderId
key: id of mailFolder
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PassThru
Returns true when the command succeeds
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserId
key: id of user
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.Graph.PowerShell.Models.IMailIdentity
Outputs
System.Boolean
Notes
ALIASES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT <IMailIdentity>
: Identity Parameter
[AttachmentId <String>]
: key: id of attachment[ExtensionId <String>]
: key: id of extension[InferenceClassificationOverrideId <String>]
: key: id of inferenceClassificationOverride[MailFolderId <String>]
: key: id of mailFolder[MailFolderId1 <String>]
: key: id of mailFolder[MentionId <String>]
: key: id of mention[MessageId <String>]
: key: id of message[MessageRuleId <String>]
: key: id of messageRule[MultiValueLegacyExtendedPropertyId <String>]
: key: id of multiValueLegacyExtendedProperty[SingleValueLegacyExtendedPropertyId <String>]
: key: id of singleValueLegacyExtendedProperty[UserConfigurationId <String>]
: key: id of userConfiguration[UserId <String>]
: key: id of user