Home

Enable archiving for users syncing from AD

%3CLINGO-SUB%20id%3D%22lingo-sub-480595%22%20slang%3D%22en-US%22%3EEnable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480595%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20team%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20trying%20to%20enable%20archiving%20for%20all%20users%20on%20our%20O365%20however%20the%20accounts%20are%20syncing%20from%20AD.%3C%2FP%3E%3CP%3EIf%20I%20update%20the%20following%20attributes%20for%20any%20user%20in%20AD%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EmsexchRemoteRecipientType%20-6%3CBR%20%2F%3EmsexchArchiveStatus%20-1%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethen%20I%20am%20able%20to%20enable%20archiving%20for%20that%20mailbox.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20are%20any%20better%20way%20to%20update%20both%20these%20custom%20attributes%26nbsp%3B%20for%20the%20users%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20the%20csv%20file%20with%20usernames%20who%20needs%20archiving.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-480595%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EActive%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EEmail%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHybrid%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIdentity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EO365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOn-Premises%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%20Commands%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-487796%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-487796%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3A%20great%20i%20tried%20that%20for%20one%20user%20and%20it%20worked..%20thank%20you...%20is%20there%20any%20way%20I%20can%20do%20it%20for%20the%20rest%20of%20450%20users%20approximately%20by%20importing%20csv%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-481442%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-481442%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20point%20was%20that%20you%20should%20be%20using%20the%20Exchange%20cmdlets%20to%20manage%20these%2C%20and%20any%20other%20Exchange-related%20attributes.%20Now%2C%20if%20you%20don't%20have%20an%20on-premises%20Exchange%20server%20anymore%2C%20you%20can%20manage%20them%20via%20the%20AD%20PowerShell%20ones%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ESet-ADUser%20-Identity%20user%40domain.com%20-Replace%20%40%7BmsexchArchiveStatus%3D%221%22%3BmsExchRemoteRecipientType%3D%226%22%7D%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-481280%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-481280%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3A%20thanks%20for%20your%20response.%20I%20have%20already%20tried%20that%20and%20I%20get%20this%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20following%20error%20occurred%20during%20validation%20in%20agent%20'Windows%20LiveId%20Agent'%3A%20'Can't%20enable%20the%20archive%20for%20'User_6d9058851b'%20because%20this%20user%20object%20is%20synchronized%20with%20the%20on-premises%20directory.%20To%20enable%20a%20cloud-based%20archive%20mailbox%20for%20this%20user%2C%20you%20must%20use%20your%20on-premises%20Exchange%20admin%20center%20or%20Exchange%20Management%20Shell.'%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BEnable-Mailbox%5D%2C%20ProvisioningValidationException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20%5BServer%3DBN6PR07MB3187%2CRequestId%3Def2cb8bf-953e-42e8-9086-a8669436ef71%2CTimeStamp%3D4%2F23%2F2019%3CBR%20%2F%3E2%3A47%3A34%20PM%5D%20%5BFailureCategory%3DCmdlet-ProvisioningValidationException%5D%20321B3F08%2CMicrosoft.Exchange.Management.Recip%3CBR%20%2F%3EientTasks.EnableMailbox%3CBR%20%2F%3E%2B%20PSComputerName%20%3A%20outlook.office365.com%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20go%20to%20AD%20server%2C%20go%20to%20this%20user's%20properties%26gt%3Bupdate%20the%20custom%20attributes%26nbsp%3B%3C%2FP%3E%3CP%3EmsexchRemoteRecipientType%20-6%3C%2FP%3E%3CP%3EmsexchArchiveStatus%20-1%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethen%20it%20works.%20however%20I%20have%20at%20least%20450%20users%20whose%20archiving%20needs%20to%20be%20enabled.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-480994%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480994%22%20slang%3D%22en-US%22%3E%3CP%3EEnable-RemoteMailbox%20is%20for%20the%20case%20where%20you%20are%20managing%20the%20identities%20on-premises.%20If%20you%20are%20all%20in%20the%20cloud%2C%20use%20Enable-Mailbox%2C%20or%20simply%20use%20the%20corresponding%20actions%20from%20the%20Exchange%20Admin%20Center%20or%20the%20Security%20and%20Compliance%20Center.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-480764%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480764%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3A%20Do%20these%20commands%20work%20for%20O365%20too%3F%20I%20thought%20these%20were%20for%20Exchane%20on-premise.%20I%20tried%20running%20the%20commands%20however%20I%20get%3A%3C%2FP%3E%3CP%3EThe%20term%20'Enable-RemoteMailbox-'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%3CBR%20%2F%3Efile%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%3CBR%20%2F%3Eand%20try%20again.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-480666%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480666%22%20slang%3D%22en-US%22%3E%3CP%3EJust%20use%20the%20Exchange%20cmdlets.%20Enable-Mailbox%20-Archive%20or%20Enable-RemoteMailbox%20-Archive%2C%20depending%20on%20the%20situation.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-489519%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-489519%22%20slang%3D%22en-US%22%3E%3CP%3EYeah%2C%20something%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EImport-CSV%20blabla.csv%20%7C%20%25%20%7B%20Set-ADUser%20-Identity%20%24_.UPN%20-Replace%20%40%7BmsexchArchiveStatus%3D%221%22%3BmsExchRemoteRecipientType%3D%226%22%7D%20%7D%3C%2FPRE%3E%0A%3CP%3Ewhere%20the%20blabla.csv%20file%20is%20supposed%20to%20have%20a%20column%20UPN%2C%20designating%20the%20user.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-542638%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20archiving%20for%20users%20syncing%20from%20AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-542638%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3A%20thanks%20man!!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Test SharePoint
Contributor

Hello team,

 

I was trying to enable archiving for all users on our O365 however the accounts are syncing from AD.

If I update the following attributes for any user in AD:

 

msexchRemoteRecipientType -6
msexchArchiveStatus -1

 

then I am able to enable archiving for that mailbox.

 

Is there are any better way to update both these custom attributes  for the users?

 

I have the csv file with usernames who needs archiving.

8 Replies

Just use the Exchange cmdlets. Enable-Mailbox -Archive or Enable-RemoteMailbox -Archive, depending on the situation.

@Vasil Michev : Do these commands work for O365 too? I thought these were for Exchane on-premise. I tried running the commands however I get:

The term 'Enable-RemoteMailbox-' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.

Enable-RemoteMailbox is for the case where you are managing the identities on-premises. If you are all in the cloud, use Enable-Mailbox, or simply use the corresponding actions from the Exchange Admin Center or the Security and Compliance Center.

@Vasil Michev : thanks for your response. I have already tried that and I get this error:

 

The following error occurred during validation in agent 'Windows LiveId Agent': 'Can't enable the archive for 'User_6d9058851b' because this user object is synchronized with the on-premises directory. To enable a cloud-based archive mailbox for this user, you must use your on-premises Exchange admin center or Exchange Management Shell.'
+ CategoryInfo : NotSpecified: (:) [Enable-Mailbox], ProvisioningValidationException
+ FullyQualifiedErrorId : [Server=BN6PR07MB3187,RequestId=ef2cb8bf-953e-42e8-9086-a8669436ef71,TimeStamp=4/23/2019
2:47:34 PM] [FailureCategory=Cmdlet-ProvisioningValidationException] 321B3F08,Microsoft.Exchange.Management.Recip
ientTasks.EnableMailbox
+ PSComputerName : outlook.office365.com

 

 

If I go to AD server, go to this user's properties>update the custom attributes 

msexchRemoteRecipientType -6

msexchArchiveStatus -1

 

then it works. however I have at least 450 users whose archiving needs to be enabled.

My point was that you should be using the Exchange cmdlets to manage these, and any other Exchange-related attributes. Now, if you don't have an on-premises Exchange server anymore, you can manage them via the AD PowerShell ones: 

 

Set-ADUser -Identity user@domain.com -Replace @{msexchArchiveStatus="1";msExchRemoteRecipientType="6"}

@Vasil Michev : great i tried that for one user and it worked.. thank you... is there any way I can do it for the rest of 450 users approximately by importing csv?

Yeah, something like this:

 

Import-CSV blabla.csv | % { Set-ADUser -Identity $_.UPN -Replace @{msexchArchiveStatus="1";msExchRemoteRecipientType="6"} }

where the blabla.csv file is supposed to have a column UPN, designating the user.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies