Using PowerShell to auto archive exchange mailboxes to *.pst.
I am trying to auto-archive terminated users' mailbox to *.pst using PowerShell. I use the commandlet, New-MailboxExportRequest. I then type in the the correct file path and mailbox name; however, I keep getting an error indicating that exchange
could not find a database suitable to store my request. Can someone please advise as to how I can remedy this error?
Hi,
Please include the full command you ran and the full error text. Also, what version of Exchange are you running?
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing)
Similar Messages
-
Using AppleScript to auto-archive mail in Outlook 2011
I want to use AppleScript to set up a schedule to auto-archive mail greater than X days old. What I've found so far is below, and the error I'm receiving is "error "Microsoft Outlook got an error: Can’t get pop account \"TargetProcess\"." number -1728 from pop account "TargetProcess"".
# the time we want to archive from
set theArchiveCutoffTime to ((current date) - (32 * days))
property theCount : 0
tell application "System Events"
set targetProcess to count (every application process whose name is "Mail")
end tell
tell application "Microsoft Outlook"
set thisAccount to pop account "TargetProcess"
set thisFolders to mail folder of thisAccount
# find the "Inbox" of topFolder and "Mail ARCHIVE" of on my computer
repeat with thisFolder in thisFolders
if name of thisFolder is "Inbox" then
set theInbox to thisFolder
else if name of thisFolder is "Mail ARCHIVE" then
set theARCHIVE to thisFolder
end if
end repeat
# find the archive "Inbox"
repeat with thisFolder in mail folder of theARCHIVE
if name of thisFolder is "Inbox" then
set theArchiveInbox to thisFolder
end if
end repeat
set theArchiveTarget to theArchiveInbox
# archive the Inbox
repeat with theMessage in message in theInbox
if time received of theMessage < theArchiveCutoffTime then
move theMessage to theArchiveTarget
set theCount to theCount + 1
else
# we get messages from oldest to newest
exit repeat
end if
end repeat
# archive sub-folders
repeat with thisSubfolder in mail folder of theInbox
# find the archive subfolder corresponding to this
repeat with thisARCHIVEubfolder in mail folder of theArchiveInbox
if name of thisARCHIVEubfolder is name of thisSubfolder then
set theArchiveTarget to thisARCHIVEubfolder
end if
end repeat
# archive messages
repeat with theMessage in message in thisSubfolder
if time received of theMessage < theArchiveCutoffTime then
move theMessage to theArchiveTarget
set theCount to theCount + 1
else
# we get messages from oldest to newest
exit repeat
end if
end repeat
end repeat
end tell
I'm working in AppleScript Editor v2.6.1 (152.1), Microsoft Outlook 2011 v14.3.5, OSX 10.9.4 Mavericks.Ok, red_menace above me had a shorter and more elegant solution to the question, I'm adding this just for another example.
To solve your problem I'd make a mail rule that looked for any messages with "Filename:" in them (along with whatever criteria you wanted, like sender, domain, etc). The mail rule would execute the Applescript. My assumption is that the "Filename:foobar" text could be anywhere in the email, not necessarily the first thing in a paragraph, so I had to parse it differently.
The results end up in a datalist, (theFilename {} ) that you can parse later to collect all filenames found in whatever messages were processed.
I realize this could be cleaner, hope it's not hard to follow, but I did it really fast. It works flawlessly for me, picking out the name of the file no matter where in the email it appears.
using terms from application "Mail"
on perform mail action with messages theSelectedMessages for rule theRule
repeat with aCounter from 1 to count theSelectedMessages
set theMessage to item aCounter of theSelectedMessages
set theContent to content of theMessage
set theWords to every word of theContent
set theFilename to {}
set tid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
repeat with thisLoop in theWords
try
if (text item 1 of thisLoop) is "Filename" then
set end of theFilename to (text item 2 of thisLoop)
-- rest of your logic goes here the display is just to show it finds the filename, take it out!
display dialog theFilename ¬
buttons {"OK"}
end if
end try
end repeat
set AppleScript's text item delimiters to tid
end repeat
end perform mail action with messages
end using terms from
Message was edited by: stephen.bradley Typos for the win! -
Office 365 - Archiving online mailboxes to PST
Good Afternoon,
We have moved our mailboxes from on premise to Office 365. Before we can delete a user from the online admin centre we need to be able to archive their mailbox to a PST in case we need access to their email in the future.
Any assistance with this matter would be greatly appreciated.
Thanks and regards.
BryanHi Bryan,
I think the feathre you need is Inactive mailboxes in Exchange Online. This feathre allows you to keep a terminated employees mailbox on your Office 365 cloud environment even after you have deleted their user account and freed up their licence.
More reference:
http://technet.microsoft.com/en-us/library/dn144876(v=exchg.150).aspx
For more details about this, I'd suggest you post in the forum of Microsoft Online: Exchange Online or
Office 365 Community, as current forum only focuses on questions and feedback for Microsoft Office client.
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
Regards,
Ethan Hua
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Attachments Moving after Moving Email from Exchange Mailbox to PST
A user with Office 2013 has an Exchange 2013 mailbox and moves some emails to an attached PST file. Attached documents in an email, such as a PDF,gets placed behind the senders email
signature making the attachment impossible to open without clicking reply/forward and moving the email signature around. You are able to select the email, Click File, Click Save Attachment and access the PDF that way.
Steps Taken Thus Far:
Repaired Office 2013.
Removed Office 2013.
Cleaned the stale registry records on the workstation.
Re-installed Office 2013.
Downloaded & installed all Office 2013 updates.
Created a new PST file in a different location and moved email with an attachment to the new PST file.
Followed the same process of moving an email to a PST file when logged on as a different user account using a different mailbox.
Thank you for any suggestions in resolving this issue.HI,
thanks for your fast reply:
My answers:
- Online Modus (no Cache).
- Tried https and TCP Mode, same Result
- Tried Save Mode, no change.
- BUT: tried with simple IMAP/POP3 - does work. So I don't think AV is guilty, otherwise here it should work aswell. Also our AV does not Scan Outlook/Mails, as this is scanned prior from the firewall. We use Avira Business.
Basically what we have:
Exchange 2013, multiple other Accounts attached from the Exchange Server.
We move Emails from one Account to another.
Once we do this, it is transferred to RTF, loosing HTML.
(Happens also if moving to Desktop, Copiing to other Mailbox, but does not happen if forwarding / sending to the other mailbox).
This happens with Outlook 2010 - which had the exact same setup when it was working, just having Exchange 2010. The Exchange 2013 Setup is new Serversetup, Outlook 2010 was modified to connect to this server.
Outlook 2013 same thing. This is, why I don't think it's any client issue. Haven't tried Office 365 though, but not sure if it's Exchange 2013 there, and there are quite some things different (eg: Password saving does work with Office 365, not with internal
Exchange when connecting from external, like that doesn't work with most Hosted Exchange Providers).
It would be good to know what the difference is, as I believe it could be a setting, but as no further reply at the other thread came, and multiple people are complaining about the same thing, I thought it's something that might get fixed with CU1 and is
considered a bug. So not sure were else to search.
This speaks against the client:
- POP3 / IMAP works (so extracting the message from the .pst doesn't modify it to RTF)
- Exchange 2010 works.
While Outlook 2010 and 2013 behave the same way.
Thanks
Patrick -
Office 365 cmdlets using Powershell 4.0
Hi
Where is the forum for:
1. Office 365 cmdlets using Powershell 4.0
2.Exchange Online using Powershell 4.0
Thanks!
- Andre
Regards Andre ThompsonPowerShell forum is here.
Windows PowerShell on TechNet
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights. -
How to use Powershell to set delegate for user mailbox in Exchange 2010 and Office 365
Hello,
Can you please tell me if I can set delegate for user mailbox in Exchange 2010 or Office 365 using Powershell?
If I can, then how can I do that? (which Powershell commands for setting the delegate?)
Many thanks, and have a good day!Hi,
If you wanted to add a delegate to possiblly a large number of users or you do this during mailbox provisioning. So the following script will use
impersonation to access another users mailbox and add a delegate.
$mbtoDelegate = "[email protected]"
$delegatetoAdd = "[email protected]"
$dllpath = "C:\Program Files\Microsoft\Exchange\Web Services\1.0\Microsoft.Exchange.WebServices.dll"
[void][Reflection.Assembly]::LoadFile($dllpath)
$service = new-object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)
$windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$sidbind = "LDAP://<SID=" + $windowsIdentity.user.Value.ToString() + ">"
$aceuser = [ADSI]$sidbind
$service.AutodiscoverUrl($aceuser.mail.ToString())
$service.ImpersonatedUserId = new-object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress,
$mbtoDelegate);
$mbMailbox = new-object Microsoft.Exchange.WebServices.Data.Mailbox($mbtoDelegate)
$dgUser = new-object Microsoft.Exchange.WebServices.Data.DelegateUser($delegatetoAdd)
$dgUser.ViewPrivateItems = $false
$dgUser.ReceiveCopiesOfMeetingMessages = $false
$dgUser.Permissions.CalendarFolderPermissionLevel = [Microsoft.Exchange.WebServices.Data.DelegateFolderPermissionLevel]::Editor
$dgUser.Permissions.InboxFolderPermissionLevel = [Microsoft.Exchange.WebServices.Data.DelegateFolderPermissionLevel]::Reviewer
$dgArray = new-object Microsoft.Exchange.WebServices.Data.DelegateUser[] 1
$dgArray[0] = $dgUser
$service.AddDelegates($mbMailbox, [Microsoft.Exchange.WebServices.Data.MeetingRequestsDeliveryScope]::DelegatesAndMe, $dgArray);
Hope this helps. -
Who has full access on all mailboxes in Exchange 2010 using Powershell ?
Greetings,
Could you please tell me how can i know Who has full access on all mailboxes in Exchange 2010 using Powershell ?
Thanks.
Redouane SARRAThis is going to depend greatly on WHICH inherited permissions you plan to delete - there are some that you can never delete if you want the system to function properly. Now, that being said, let's look at some example permissions. First, here
are some permissions on a standard mailbox:
Identity User AccessRights
IsInherited Deny
users.corp.... USERS\btwatcher {FullAccess}
False False
users.corp.... USERS\svcactAdmin {FullAccess}
True False
users.corp.... CORP\Domain Ad... {FullAccess}
True True
users.corp.... CORP\Enterpris... {FullAccess}
True True
users.corp.... CORP\Organizat... {FullAccess}
True True
users.corp.... CORP\adminact {FullAccess}
True True
users.corp.... CORP\esswin {FullAccess}
True True
users.corp.... USERS\svcactEncase {FullAccess}
True False
users.corp.... CORP\Exchange ... {FullAccess}
True False
users.corp.... NT AUTHORITY\SYSTEM {FullAccess}
True False
As you can see, the first is not inherited. All others are, and two are from service accounts (svcact...). Also, some are Exchange system permissions, some are denies, and some are just administrative accounts. Once you determine which
you wish to remove, the SIMPLEST way to set the permissions you want is to open the account properties in ADSIEdit, and go to the Security tab. Here, click the Advanced button and find the inherited permission you wish to remove. ADSIEdit will
show where the permission is inherited from - you will need to go to that container to remove the inherited permission. You can also grant inherited denies at the same level(s).
Now, something you will need to understand is that if you hope to remove permissions granted to domain administrators, the system will replace them - these permissions are required by the system and can't be modified permanently. -
Online Archiving and Mailbox sharing exchange 2010
Hi Guys
is it possible to share a mailbox without sharing the online archive attached to it, the issue I'm having is that one of my users is sharing his mailbox with his PA, he happens to have a very large amount of subfolders under all his folders and not just
the inbox, this also includes his sent items and deleted items that have subfolders in them too, his PA happens to need access to these folders too. but with the online archive attached, the amount of subfolders connected appear to be more than outlook can
handle, and it throws an out of memory error and the user then has to restart outlook before being able to send any mails again. alternatively is there a way to share all the subfolders without painstakingly setting the permissions on each folder one by one.
CheersYou can open the database where user mailbox is located in ExFolders and then add permission for Inbox folder and then propagate that permission to all subfolders.
This article is using PFDavAdmin but will help you to understand what you need to do via ExFolders on Exchange 2010...
http://www.nigelboulton.co.uk/2010/12/delegating-and-propagating-exchange-folder-permissions-using-pfdavadmin/
Blog |
Get Your Exchange Powershell Tip of the Day from here -
Auto archiving Outlook for pop3 mailbox
I know it is possible to set auto archiving in outlook with the implementation of rules for exchange account.
I wonder if auto archiving can be performed for pop3 accounts. Basically trying to auto-archive old email from outlook and save them in NAS device. Don't want to run Time Machine as it will start to backup the whole system.Hi,
According to your description, I noticed that “If we type in the user's email address and name and click Next, the profile is created successfully”. Do you mean the linked mailbox can be setup automatically when you fill in the Name and E-mail Address in
the Auto Account Setup page? For example:
If that is the case, the autodiscover service in Exchange side should be configured correctly and it is working for Outlook client automatically account setup.
If the account can’t be setup automatically when using autodiscover service, please
verify that the Master Account (Domain2\User1) has full access to the Linked Mailbox ([email protected]) as well as the smtp address using the cmdlets Get-Mailbox and Get-MailboxPermission in Exchange server:
Get-Mailbox [email protected] | fl PrimarySmtpAddress,*Type*,*Link*
Get-MailboxPermission [email protected] | fl
Regards,
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
Winnie Liang
TechNet Community Support -
Auto-Mapping Exchange 2013 Mailboxs in an Exchange 2010 Mailbox
We're in the middle of migrating mailboxes from Exchange 2010 to Exchange 2013. Many of our users have Auto-Mapped mailboxes as well. In my testing, I've found that I cannot Auto-Map a mailbox that's on Exchange 2013 in a Exchange 2010 mailbox. I can manually
add it and it works fine. Is this by design with this type of coexistence or is there a fix for it? Our current Exchange 2010 environment is at SP3 with UR2.
Orange County District AttorneyThis issues is fixed in UR5 so suggest you to upgrade Exchange 2010 to SP3 UR5.
Reference Thread: http://social.technet.microsoft.com/Forums/exchange/en-US/a2aa4163-f74b-401f-aec5-13324e6b29c8/exchange-2010-mailbox-not-able-to-access-automapped-exchange-2013-cu3-mailbox?forum=exchangesvradmin
Blog |
Get Your Exchange Powershell Tip of the Day from here -
Exchange 2010 mailbox not able to access auto-mapped Exchange 2013 CU3 mailbox
Hi,
We are in co-existence with Exchange 2010 SP3 and Exchange 2013 CU3.
Outlook Anywhere and Autodiscover pointed towards Exchange 2013 CAS servers. Everything works fine irrespective where is mailbox is located Exchange 2010 or 2013.
When I tried to access auto-mapped mailbox from Exchange 2010 as primary mailbox accessing auto-mapped Exchange 2013 mailbox "Cannot expand the folder. The set of folders cannot be opened. Microsoft Exchange is not available. Either there are network
problems or the Exchange server is down for maintenance".
Exchange 2013 OutlookAnywhere "Externalclientauthenticationmethod" is Basic and "Internalclientauthencitcationmethod" is NTLM. Everything is setup as per the Tech-net recommendations.
Checked both these articles but still it is not working:
http://support.microsoft.com/kb/2839517
http://support.microsoft.com/kb/2834139
Please let me know if there are any other ideas.
RamanHi,
I recommend you refer to the following articles to troubleshoot the issue:
Troubleshooting Mailbox Auto-Mapping : Autodiscover
Details about the shared mailbox that is to be accessed will be returned to the Outlook client by the autodiscover process. This is really handy to know if you are ever in the position where you need to troubleshoot why the auto-mapping feature isn’t working
correctly
Troubleshooting Mailbox Auto-Mapping : Permissions
When you use either the Exchange Management Console or the Exchange Management Shell to grant a user with full access permission against another mailbox, permissions changes are made to allow this as you might expect. Certain Active Directory attributes
are also updated to reflect both the Active Directory account of the mailbox being accessed as well as the Active Directory account of the accessing mailbox. Specifically, you can check the contents of the msExchDelegateListLink and msExchDelegateListBL Active
Directory attributes to see these details and it is worth checking these if you have any suspicions that things aren’t working correctly.
Hope this helps!
Thanks.
Niko Cheng
TechNet Community Support -
Set storage quota on multiple mailboxes using PowerShell?
I need to set storage quota limits on multiple mailboxes using PowerShell. I understand I can create a .csv file with aliases and pipe that into a cmdlet, eg.,
Import-CSV "C:\temp\alias.csv" | % {Set-Mailbox -identity $_.alias -IssueWarningQuota 900mb -ProhibitSendQuota 950mb -ProhibitSendReceiveQuota 1gb -UseDatabaseQuotaDefaults $false
Is there any other way of doing this with a much more robust script?
Any help would be much appreciated.
Hi,
Is there any special attribute for these multiple mailboxes? such as they are from a specific OU or a distribution group etc.
If there is, we can direct use the filter to pick out these mailboxes instead of create .csv file for them. The following example can set storage quota for mailboxes in a distrobution group Group1:
Get-DistributionGroupMember -Identity Group1 | ForEach{ Set-Mailbox -identity $_.Name -IssueWarningQuota 900mb -ProhibitSendQuota 950mb -ProhibitSendReceiveQuota 1gb -UseDatabaseQuotaDefaults $false}
The following example is used to set storage quota for mailboxes from Exchange Department:
Get-Recipient | Where-Object {$_.Department -eq 'Exchange'} | ForEach{ Set-Mailbox -identity $_.Name -IssueWarningQuota 900mb -ProhibitSendQuota 950mb -ProhibitSendReceiveQuota 1gb -UseDatabaseQuotaDefaults $false}
Regards,
Winnie Liang
TechNet Community Support
Hi,
Is there any special attribute for these multiple mailboxes? such as they are from a specific OU or a distribution group etc.
If there is, we can direct use the filter to pick out these mailboxes instead of create .csv file for them. The following example can set storage quota for mailboxes in a distrobution group Group1:
Get-DistributionGroupMember -Identity Group1 | ForEach{ Set-Mailbox -identity $_.Name -IssueWarningQuota 900mb -ProhibitSendQuota 950mb -ProhibitSendReceiveQuota 1gb -UseDatabaseQuotaDefaults $false}
The following example is used to set storage quota for mailboxes from Exchange Department:
Get-Recipient | Where-Object {$_.Department -eq 'Exchange'} | ForEach{ Set-Mailbox -identity $_.Name -IssueWarningQuota 900mb -ProhibitSendQuota 950mb -ProhibitSendReceiveQuota 1gb -UseDatabaseQuotaDefaults $false}
Regards,
Winnie Liang
TechNet Community Support
Creating multiple mailboxes using Powershell for users who already exist in AD
Hi there,
Wondering if anyone can help, I am wanting to use Powershell to run a command which references a CSV file to create a mailbox for a user who already exists in AD.
It needs to reference the username, to ensure the correct user has a mailbox created (as mentioned they exist already in the domain), place them on a specific database (e.g DB1) and assign them an email address as well as possibly an alias email address
too.
Can anyone provide me the headings of the CSV file which would be needed as well as the powershell command to run. It would be great too if I could also set the quota sizes for the user at the same time of creating the mailbox, but if not possible or complicated
I can run a script afterwards to do this. I would only want to warn them when their mailbox is 1.5GB in size and stop them sending when it reaches 2GB.
Thanks
So create a csv file with the following headers and data
UserID, Alias
UserID should be the user SamAccountName, and the Alias is the Mailbox Alias that you want to set. Supposing that the csv file is named users.csv and located under C:\ , open the Exchange Management Console and run:
$users = Import-Csv c:\users.csv
Foreach ($user in $users) {
Enable-Mailbox -Identity $user.UserID -alias $user.alias -database 'DB1'
Set-Mailbox -Identity $user.UserID -IssueWarningQuota 1.5gb -ProhibitSendQuota 2gb
Please Mark As Answer if this helps
ammarhasayen
How can I block all other mail account just to only use the exchange mailbox of our company? This is to prevent the user to setup his on company iPhone.
I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
Thanks again for "anyone" that can help me!!!
Disconnecting Exchange Mailbox Using AD Adapter
Has anyone disconnected Exchange Mailbox from the user using the AD adapter? We would like to understand what Sun's official stance is in doing this.
Could we disconnect by simply setting the following attributes to NULL or ""?
1. homeMTA
2. homeMDB
3. msExchangeHomerServerName
We do not wish to delete an Exchange Mailbox, simply disconnect (equivalent to disable of mailbox)
Thank you
If you have one group doing all mailbox creation, you won't get automatic creation to rely on user location. We use a script for creating mailboxes on the next logical server. You could do the same thing, but with logic that took into consideration
the user location.
Maybe you are looking for
-
How to I get missing music files back after itunes 11 update?
The following error i appears " The song " -------------- " could not be used because the original file could not be found. Would you like to locate it?". It appears on about 40% of my tracks. No problem before the update.
-
I have a problem since a few days: pdf files do not open anymore in safari.Thank you for your help. Claude
-
How do i get my contacts from my old Galaxy S4 over to my new GS6
I am struggling to transfer my contacts from my old Galaxy S4 to my new Galaxy S6!! Getting very frustrated! angie
-
Using Xnest -query localhost when in "netservices limited" mode?
hi, I'm trying to get Xnest to work (so I can remote desktop over ssh) - on Solaris 10 1/08 express developer Xnest works fine when in "netservices open" mode but not when in "netservices limited" mode I'd rather runs as limited and just enable the t
-
Sales Document Type blocked for customer
Good afternoon! Is there anyway I could block a sales doc type for a particular customer? Adriano Cardoso