question

DanielKaliel-3171 avatar image
0 Votes"
DanielKaliel-3171 asked DanielKaliel-3171 answered

Microsoft Office has identified a potential security concern

We have a powershell script that users can run that copies the templates we use internally from an internal network location \... to a local folder.

For the past 2 months when users run the script they get a Microsoft Word Security Notice that kills the script.

109076-word-notice.jpg



The source location and the destination location are both in the Trusted Sources list in all MS office applications.

office-word-itpro
word-notice.jpg (42.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DanielKaliel-3171 avatar image
0 Votes"
DanielKaliel-3171 answered

There must be a change in powershell or something. This error was being thrown by the following line in the powershell script to obtain the Word version installed and installation path of Word.

New-Object -ComObject word.application

I stopped using the ComObject to obtain that information and instead pulled it out of the registry with these lines instead.

$version = (Get-ItemProperty HKLM:Software\Classes\Word.Application\CurVer).'(default)'
$wPath = (Get-ItemProperty HKLM:SOFTWARE\Microsoft\Office\$version.0\Word\InstallRoot).Path

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.