Github user richardcloudsoft commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/650#discussion_r31115419
--- Diff: docs/guide/yaml/winrm/re-authentication.md ---
@@ -0,0 +1,38 @@
+---
+title: Re-authenticating within a powershell script
+title_in_menu: Re-authentication
+layout: website-normal
+---
+
+## How and Why to re-authenticate withing a powershell script
+
+Brooklyn will run powershell scripts by making a WinRM call over HTTP. For
most scripts this will work, however for
+some scripts (e.g. MSSQL installation), this will fail even if the script
can be run locally (e.g. by using RDP to
+connect to the machine and running the script manually)
+
+In the case of MS SQL server installation, there was no clear indication
of why this would not work. The only clue was
+a security exception in the installation log
+
+It appears that when a script is run over WinRM over HTTP, the credentials
under which the script are run are marked as
+'remote' credentials, which are prohibited from running certain
security-related operations. The solution was to obtain
+a new set of credentials within the script and use those credentials to
exeute the installer, so this:
+
+```
+( $driveLetter + "setup.exe") /ConfigurationFile=C:\ConfigurationFile.ini
+```
+
+became this:
+
+$pass = '${attribute['windows.password']}'
--- End diff --
Fence with ``` otherwise the formatting is mangled.
(In fact, fence with ```powershell to get syntax highlighting)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---