<div dir="ltr">Hi, all!<div><br></div><div>I have an Active Directory resource to which I added an SSH connector. My goal is to create a mailbox on the Exchange server for a new user. For this I use the following script:<br><br><font face="arial, sans-serif"><i>        <script><br>            <host>resource</host><br>            <language>powershell</language><br>            <argument><br>                <name>givenName</name><br>                <path>$user/givenName</path><br>            </argument><br>            <argument><br>                <name>familyName</name><br>                <path>$user/familyName</path><br>            </argument><br>            <argument><br>                <name>email</name><br>                <script><br>                    <code><br>                     email = user.getGivenName() + user.getFamilyName() + '@<a href="http://idm.ru/" target="_blank">idm.ru</a>'<br>                     return email<br>                  </code><br>                </script><br>            </argument><br>            <code>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell; New-Mailbox -Name $givenName$familyName -UserPrincipalName $email -Password (ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force)"</code><br>            <operation>modify</operation><br>            <order>after</order><br>        </script></i></font><br></div><div>The command to be executed looks like this:<font face="arial, sans-serif"><i><br></i></font></div><div><br></div><div><i>$givenName = 'Assol'; $familyName = 'Vandenguk2'; $email = '<a href="mailto:AssolVandenguk2@idm.ru" target="_blank">AssolVandenguk2@idm.ru</a>'; C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell; New-Mailbox -Name $givenName$familyName -UserPrincipalName $email -Password (ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force)"</i><br></div><div><i><br></i></div><div>This doesn't work. I understand this because the command is executed in cmd.exe, not powershell.</div><div><br></div><div>Is it possible to somehow make the command work?</div></div>