Reputation: 75
This is a little bit of a weird question, but I'm part of an organization and I'm trying to write a script that opens Outlook as a part of it. Here are the lines I have:
$key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE\'
$exe = (Get-ItemProperty -Path $key).'(default)'
& $exe
For some reason, if I open it this way, it doesn't detect my profile and asks me for my email address and password which should be autodiscovered. If I click on it from the taskbar or directly on the Outlook.exe, it just shows the Outlook logo and then opens my mailbox.
This is Office 365. Any help would be greatly appreciated, thanks!
Upvotes: 0
Views: 34
Reputation: 66286
Outlook uses profiles (see Control Panel | Mail | Show Profiles). They are stored on the per user level in HKCU. If you script runs under the identity of a different user, Outlook does not see any profiles and prompts you to create one and connect to some mailbox.
Upvotes: 1