'How to access outlook object using powershell script without a security prompt?
I have prepared powershell script which access outlook to save the attachment and prepare the new report. Currently my script always ask/throws the pop up asking 'allow' accessing outlook or outlook attachment? I want script to be automatically access the outlook and attachment. How this can be achieved using powershell? or is there any other way in outlook to automatically give permission.
Thanks, Amita Jathar
Solution 1:[1]
Use GetNameSpace ("MAPI") to return the Outlook NameSpace object from the Application object.
$Namespace = $Outlook.GetNameSpace("MAPI")
MAPI is the only data source supported, which allows access to all Outlook data stored in the user's mail stores.
The object itself provides methods for logging in and out, accessing storage objects directly by ID, accessing certain special default folders directly, and accessing data sources owned by other users.
So you need not provide any manual input to get the action done.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ramnarayan_Kotagiri |