Avatar of mkllpit
mkllpit
Flag for United States of America asked on

Powershell Script error - Exchange

I've found this script that would enable us to input Outlook Calendar meetings into users calendars without an invite.

http://www.slipstick.com/exchange/cmdlets/use-powershell-import-appointments/

 I get an error:
 Unable to index into an object of type System.Management.Automation.PSObject.
 At D:\Program Files\Microsoft\Exchange Server\V14\Bin\Import-CalendarCSV.ps1:72 char:16
 +     if (!$CSVFile[ <<<< 1].$Key)
     + CategoryInfo          : InvalidOperation: (1:Int32) [], RuntimeException
     + FullyQualifiedErrorId : CannotIndex
PowershellScripting LanguagesExchange

Avatar of undefined
Last Comment
footech

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
footech

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mkllpit

ASKER
thanks. I added a second line, and that error went away. Can you assist with these errors now?

Exception calling "LoadFile" with "1" argument(s): "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
At D:\Admin\Import-CalendarCSV\Import-CalendarCSV\Import-CalendarCSV.ps1:90 char:39
+  [void][Reflection.Assembly]::LoadFile <<<< ($EWSManagedApiPath);
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

Performing autodiscover for sgrossman@mkllptest.com
Exception calling "AutodiscoverUrl" with "1" argument(s): "The Autodiscover service couldn't be located."
At D:\Admin\Import-CalendarCSV\Import-CalendarCSV\Import-CalendarCSV.ps1:120 char:27
+         $service.AutodiscoverUrl <<<< ($EmailAddress);
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : DotNetMethodException
mkllpit

ASKER
Ok, I think I fixed the first error, just this one:

Exception calling "AutodiscoverUrl" with "1" argument(s): "The Autodiscover service couldn't be located."
At D:\Admin\Import-CalendarCSV\Import-CalendarCSV\Import-CalendarCSV.ps1:120 char:27
+         $service.AutodiscoverUrl <<<< ($EmailAddress);
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : DotNetMethodException
footech

I don't think I can help you on that one.   Though I do see on line 93 it appears to reference Exchange 2007.  Is that the version you're using?  If not, you might have to change the command.
https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeversion%28v=exchg.80%29.aspx?f=255&MSPPError=-2147217396
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
mkllpit

ASKER
hmmm, good eye, we're using Exchange 2010, I'll check that. Thanks!
footech

Original question was answered.
I'd suggest starting a new question for any follow up questions.