<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic cannot map a drive on WFA from script - works from command line in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62496#M13054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I am trying to map a drive on the wfa server from a script so I can set ntfs permissions. I am using&amp;nbsp;&amp;nbsp; net use t: \\192.168.77.182\cifstest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works from the command line.&amp;nbsp;&amp;nbsp; However, when I try to run from the script, I get error 1223.&amp;nbsp; Below is what I am trying to do and relevant details below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$ErrorArg = 'Stop'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$credentials = Get-WfaCredentials -Host 'local'&lt;/P&gt;&lt;P&gt;$expression = $("net use s: \\192.168.77.182\cifstest")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("creds: " + $credentials)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("Command to invoke: " + $expression)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$job = Invoke-Command -computername localhost&amp;nbsp; -credential $credentials -scriptblock {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $output = Invoke-Expression $args[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;} -argumentlist $expression -ErrorAction $ErrorArg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;relevant details:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WFA service using domain admin account&lt;/P&gt;&lt;P&gt;svm has domain admin account in the vserver admin group&lt;/P&gt;&lt;P&gt;local cached credential is domain admin &amp;amp; password&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has a known good alternate way to do this, I would be grateful for the tip&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 05:35:04 GMT</pubDate>
    <dc:creator>stephen2</dc:creator>
    <dc:date>2025-06-05T05:35:04Z</dc:date>
    <item>
      <title>cannot map a drive on WFA from script - works from command line</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62496#M13054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I am trying to map a drive on the wfa server from a script so I can set ntfs permissions. I am using&amp;nbsp;&amp;nbsp; net use t: \\192.168.77.182\cifstest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works from the command line.&amp;nbsp;&amp;nbsp; However, when I try to run from the script, I get error 1223.&amp;nbsp; Below is what I am trying to do and relevant details below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$ErrorArg = 'Stop'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$credentials = Get-WfaCredentials -Host 'local'&lt;/P&gt;&lt;P&gt;$expression = $("net use s: \\192.168.77.182\cifstest")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("creds: " + $credentials)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-WFALogger -Info -message $("Command to invoke: " + $expression)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$job = Invoke-Command -computername localhost&amp;nbsp; -credential $credentials -scriptblock {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $output = Invoke-Expression $args[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;} -argumentlist $expression -ErrorAction $ErrorArg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;relevant details:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WFA service using domain admin account&lt;/P&gt;&lt;P&gt;svm has domain admin account in the vserver admin group&lt;/P&gt;&lt;P&gt;local cached credential is domain admin &amp;amp; password&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has a known good alternate way to do this, I would be grateful for the tip&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:35:04 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62496#M13054</guid>
      <dc:creator>stephen2</dc:creator>
      <dc:date>2025-06-05T05:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: cannot map a drive on WFA from script - works from command line</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62501#M13056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide some more details?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. What is the error thrown? Place a screenshot or paste the error message.&lt;/P&gt;&lt;P&gt;2. WFA version&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error code 1223 is for System Error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2014 18:23:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62501#M13056</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2014-06-02T18:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: cannot map a drive on WFA from script - works from command line</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62506#M13058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;version is 2.2.0.2.4RC1&amp;nbsp;&amp;nbsp; looks like a winrm problem, but I verified trustedhosts are setup for the ip address and for localhost.&amp;nbsp; Cannot use HTTPS as I dont have a certificate.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error message below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14:42:14.168 INFO&amp;nbsp; [aa connect to share] ### Command 'aa connect to share' ###&lt;/P&gt;&lt;P&gt;14:42:16.773 INFO&amp;nbsp; [aa connect to share] Executing command: ./aa_connect_to_share1523475247892358711.ps1 &lt;/P&gt;&lt;P&gt;14:42:19.223 INFO&amp;nbsp; [aa connect to share] Credentials successfully provided for 'local'&lt;/P&gt;&lt;P&gt;14:42:19.347 INFO&amp;nbsp; [aa connect to share] creds: System.Management.Automation.PSCredential&lt;/P&gt;&lt;P&gt;14:42:19.441 INFO&amp;nbsp; [aa connect to share] Command to invoke: net use s: \\192.168.77.182\cifstest&lt;/P&gt;&lt;P&gt;14:42:19.769 ERROR&amp;nbsp; [aa connect to share] Connecting to remote server failed with the following error message : The WinRM client cannot process the request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.&lt;/P&gt;&lt;P&gt;14:42:19.925 ERROR&amp;nbsp; [aa connect to share] Failed executing command. Exception: Connecting to remote server failed with the following error message : The WinRM client cannot process the request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2014 19:47:48 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62506#M13058</guid>
      <dc:creator>stephen2</dc:creator>
      <dc:date>2014-06-02T19:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: cannot map a drive on WFA from script - works from command line</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62511#M13060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;stephen2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Let's put WFA out of picture and confirm everything works fine outside of it. You first need to confirm that winrm ( windows remote management) is properly configured for Invoke-command to work using simple commands. Open a powershell console and run this:&lt;/P&gt;&lt;P&gt;===&lt;/P&gt;&lt;P&gt;#provide the credentials here&lt;/P&gt;&lt;P&gt;$Creds=Get-Credential&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Now invoke-Command&lt;/P&gt;&lt;P&gt;Invoke-Command -ComputerName localhost -Credential $Creds -ScriptBlock { date }&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;If this doesn't print the current date, then your winrm first needs proper configuration. Until this gets to work, trying with WFA command is of no use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12.727272033691406px; font-family: Arial, Helvetica, Verdana, sans-serif; color: #454545; background-color: #ffffff;"&gt;winrm set winrm/config/client '@{TrustedHosts="wfa_hostname_or_IP"}'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12.727272033691406px; font-family: Arial, Helvetica, Verdana, sans-serif; color: #454545; background-color: #ffffff;"&gt;Give the IP address instead of word localhost.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. In a&amp;nbsp; script code, the contents inside the -scriptBlock needs to be type-casted, &lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; font-family: Arial, Helvetica, Verdana, sans-serif; color: #454545; background-color: #ffffff;"&gt;$job = Invoke-Command -computername localhost&amp;nbsp; -credential $credentials &lt;SPAN style="color: #ff0000;"&gt;-scriptblock { &lt;SPAN style="line-height: 1.5em;"&gt;$output = Invoke-Expression $args[0] } &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my example code here: &lt;A _jive_internal="true" href="https://community.netapp.com/message/127151#127151" title="https://communities.netapp.com/message/127151#127151" target="_blank"&gt;https://communities.netapp.com/message/127151#127151&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. I don't think you need to use this Invoke-Expression inside the -scriptBlock. Once type-casted, it should b working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sinhaa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 03:23:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/cannot-map-a-drive-on-WFA-from-script-works-from-command-line/m-p/62511#M13060</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2014-06-03T03:23:21Z</dc:date>
    </item>
  </channel>
</rss>

