Import PST file to specific mailbox with a Account with Full Access rights - outlook-redemption

I am working on a command line tools which can Import PST file to specific mailbox (or any mailbox) with an Account with Full Access rights, What is the best way to archive this?
Redemption Redemption DLL, could be an option, is there any code example to do the import pst?
I know there is PowerShell function: New-MailboxImportRequest, first it require Exchange Powershell module, by using the powershell, I lost control, don't know when the import is finished and if there is any error.
Really appreciate any suggestion.

Related

Parse .msg outlook file with flutter/dart

I need help running this python code in a windows flutter app
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
msg = outlook.OpenSharedItem(r"C:\test_msg.msg")
using the win32 package, as I can't understand how to use it... I'm quite sure it's doable since this is available in the package and seems to be what is needed...
The most easiest way is to automate Outlook for that like the Python code does. Be aware, the code mentioned make sense only for Windows machines. The COM technology doesn't exists on other platforms.
Also you can find the MSG file format described in depth in MSDN. So, you may search for existing parsers over the internet or create your own.

Updating own software in Program Files

I have a single executable which, via InnoSetup, installs into Program Files\FolderName by default. The exe has a 3rd party component which goes online to check for new versions and downloads them, then does a bit of fiddling to replace the exe - simple stuff. The problem is, it can't do this in Program Files because of the necessary security there. I was reading Windows 7 - Can't update my program's files in C:\Program Files in which David Hefferman gives a solution but then seems to say it's a bad idea - but I don't know whether the bad idea bit refers to his solution or to the OP's comments!
So what is the preferred method by which a program can update itself? One that will work on XPSP3 to Win8. I can't seem to find the right phrase to enter into Google that gives me relevant results. Ignore digital signatures and suchlike for now, for simplicity.
(Please note, it may look like I worded that as an opinion question but it's not - there must be some MS-endorsed way of doing it that I can't find. FWIW this is a Delphi program but any Win32 notes will do)
That 3rd party update utility needs to be run with administrative privileges, you can achieve that programmatically.
There is nothing wrong with installing your application in Program Files, that is the designated purpose of this folder. However, user data that is used by the application should be stored in a different location.
However you run that 3rd party Utility, you should first check the Windows OS version to see if fiddling with UAC is really necessary(Vista+...) and then run the utility in the elevated state.
He says its "extremely bad practice" to fiddle with your system so that normal users can write in "Program Files".
If your program is in "Program Files" it's installed with System Admin rights. So updates need also be installed with System Admin rights.
You can configure InnoSetup to request admin-rights so you can write to "Program Files" but if the 3rd party component does not do this its best to install everything in an other directory.
i.e. C:\Your_Program
That way your 3rd party component can write there.
There are several options here:
The easiest: make updater as a separate program with manifest, which requires admin privileges. Also you can ask for admin privileges when you start your updater. Or you can move your updater into out-of-process COM object instead of separate exe.
You can create hidden user with admin rigths during installation of your program. Then you will run your updater with credentials of this user.
You can install system service during installation of your program and this service will run from system account. So your updater will be implemented as a service.

How can I generate LPK file without the GUI of LPK_tool

I use the lpk_tool.exe to generate the LPK file for my ActiveX control. But it seems that Microsoft have abandoned this technology, I cannot even find the download link on Microsoft Download.
But that's not a problem, I can download it from other website. The problem is now I want generate LPK file without the GUI. I tried to find the API or command line support for LPK tool, but failed to find any. I have also asked the support form Microsoft and they don't provide the API or source code of the LPK tool.
Anyone can help me?

Logger does on work in RestrictedPython script in Plone

How to print in a .cpy file (python) ? I'm using Zope/Plone and I've just started with Python. I've tried this
import logging
logger = logging.getLogger()
logger.info("hello plone")
But it doesn't work.
Thank you for your answer
The answer above means that you cannot import any modules in RestrictedPython scripts which are through-the-web editable Plone scripts. These scripts have end-user permissions, so they are not allowed to run arbitrary Python code.
http://collective-docs.readthedocs.org/en/latest/security/sandboxing.html
You can use context.plone_log("mystring") style logging in restricted python scripts for logging purposes.
"It doesnt' work" is awfully vague, but your problem is probably a violation of the security sandbox imposed on Python used in scripts that may be edited through the web. "Restricted Python" limits your imports to modules that have been audited to assure that they don't have nasty side effects -- like dumping noise into logs. See http://wiki.zope.org/zope2/PythonScripts for details on Restricted Python.
The general solution to this kind of problem is to build your functionality in unrestricted Python in a Python package. A Zope named utility is the usual mechanism for providing this kind of functionality, and you'll be able to reach the utility's operations from restricted Python by traversing to the named utility.

Programatically assign network service access rights to folder using Delphi 2010

I need the following information
How to get "C:\Document and settings\Network service" folder of XP OS
programmatically from Delphi2010?
What is the equivalent of above folder in Vista and Win7 OS ?
I need to set the Network Service"
account full rights for the above folder thru Delphi 2010
Any help on the above is highly appreciated!!
Thanks in adv
Ven
Here you go:
1) For WinXP: Use SHGetFolderPath API with CSIDL CSIDL_PROFILE to get the folder of your own profile (e.g. "C:\Documents and Settings\Steve"), remove your own name (the Steve part) and add NetworkService (giving you "C:\Documents and Settings\NetworkService"). There seems to be no direct way to get the Documents and Settings folder.
(Example for SHGetFolderPath usage: http://delphi.about.com/od/kbwinshell/a/SHGetFolderPath.htm)
2) For Win7 the location changed to "%windir%\ServiceProfiles\NetworkService", this is commonly "C:\Windows\ServiceProfiles\NetworkService". Don't know for Vista, might be the same.
3) The easiest way seems to be the approach described here: Create folder/file and set permissions
You can start the CACLS programm via ShellExecute API. See example of usage here: http://delphi.about.com/od/windowsshellapi/a/executeprogram.htm

Resources