# Script only works with its creator !?!

**URL:** <https://forums.powershell.org/t/script-only-works-with-its-creator/20563>\
**Category:** PowerShell Help\
**Created:** [October 3, 2022, 5:11pm UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563 "2022-10-03T17:11:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scriptum](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Scriptum](https://forums.powershell.org/u/Scriptum)\
**Post date:** [October 3, 2022, 5:11pm UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563/1 "2022-10-03T17:11:54Z")

</div>

Hello,

I’ve to test a PS script using an API (bastion software) but it works only when launched by its creator !?!

For the moment, the user “admin” and the API key are set in the script.  
The Windows user I use to test is in the same AD groups and application groups as the author of the script.

What could be the problem ?  
How can I troubleshoot this issue ?  
It seems to be a profile problem but how can I check that ?  
(it is quite strange because users are created by automatic or very well defined processes)

Regards,

Steve.

---

<div class="post-metadata">

**Author:** ![matt-bloomfield](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matt-bloomfield](https://forums.powershell.org/u/matt-bloomfield)\
**Post date:** [October 3, 2022, 5:51pm UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563/2 "2022-10-03T17:51:11Z")

</div>

Hi, welcome to the forum 👋

Is the API key hardcoded in the script, or is it set by reading an encrypted standard string from disk? If it’s the latter, it can be decrypted only by the user that created it, on the machine it was created on.

If it’s not that, then you’ll need to provide more detail such as what’s not working, what error messages you’re getting and, ideally, a copy of the script with any sensitive information replaced.

If you do post code or errors, please ensure your post is formatted correctly:

[How to format code on PowerShell.org](https://aws1.discourse-cdn.com/business5/uploads/powershell/original/2X/b/bee50c628238f2c076c0504efb6b15f2fb11f002.gif)

---

<div class="post-metadata">

**Author:** ![alex-innes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/alex-innes/32/129_2.png) [@alex-innes](https://forums.powershell.org/u/alex-innes)\
**Post date:** [October 4, 2022, 11:31am UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563/3 "2022-10-04T11:31:21Z")

</div>

Not knowing the specifics of the error, I would say is it potentially could be the execution policy blocking the script from running?  
[Execution Policy](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.2)

---

<div class="post-metadata">

**Author:** ![Scriptum](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Scriptum](https://forums.powershell.org/u/Scriptum)\
**Post date:** [October 4, 2022, 5:52pm UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563/4 "2022-10-04T17:52:09Z")

</div>

Hello,

The developer has found the cause of the prob. by performing a JSON transformation then a “print” at the level of the “try … catch” to have maximum details at the time of the error.

Detailed message obtained:  
“The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer’s first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.”

Unbelievable ! An adherence to IE on a W2019 server!!!

Solution:  
Launch IE the first time and check “Don’t use recommended settings”. 🙂

It was therefore a problem of setting IE for the user executing the script!

Well, I hope this wil help others because it took our minds for a while.

Steve.

---

<div class="post-metadata">

**Author:** ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)\
**Post date:** [October 4, 2022, 7:47pm UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563/5 "2022-10-04T19:47:20Z")

</div>

Not surprised. M$ is still deploying slmgr.vbs for Windows licensing.

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [October 4, 2022, 10:09pm UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563/6 "2022-10-04T22:09:34Z")

</div>

Depending on what’s invoking the webrequest/API you may be able to control whether it cares about IE first run. Invoke-webrequest and invoke-restmethod on windows powershell offer a “usebasicparsing” parameter which doesn’t require IE engine.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:16pm UTC](https://forums.powershell.org/t/script-only-works-with-its-creator/20563/7 "2024-05-16T20:16:31Z")

</div>


