Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Restore-MsolUser

Published: March 22, 2013

Updated: January 21, 2014

Applies To: Office 365, Windows Azure, Windows Intune

noteNote
  • This topic provides online help content for cloud services, such as Windows Intune and Office 365, which rely on Windows Azure Active Directory for identity and directory services.

  • The Windows Azure Active Directory Module for Windows PowerShell cmdlets were previously known as the Microsoft Online Services Module for Windows PowerShell cmdlets.

This cmdlet restores a user that is in the Deleted users view to their original state. Users will remain in the Deleted users view for 30 days.

Restore-MsolUser [-AutoReconcileProxyConflicts] [-NewUserPrincipalName <string>] [-ObjectId <Guid>] [<CommonParameters>]
    -AutoReconcileProxyConflicts [<SwitchParameter>]
        If set, then any proxy addresses that cause conflicts will be removed 
        for the user. This parameter should be used if one or more of the 
        user's proxy addresses is also used for another active user.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -NewUserPrincipalName <string>
        The UserPrincipalName to use when restoring the user. This should be 
        used if the original UserPrincipalName of the user is in use by 
        another active user.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -ObjectId <Guid>
        The ObjectId of the user to restore.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -UserPrincipalName <string>
        The user ID of the user to restore.
        
        Required?                    true
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        "get-help about_commonparameters".

The following commands will restore a user that was deleted. The user principal name of the deleted user is FSlattery@contoso.com. The first command maps the variable $DelUser to the deleted user. The second command restores the deleted user.

$DelUser = Get-MsolUser -UserPrincipalName FSlattery@contoso.com -ReturnDeletedUsers
Restore-MsolUser -ObjectId $DelUser.ObjectId

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.