<Activity mc:Ignorable="sads sap" x:Class="Microsoft.RemoteDesktopServices.Workflow.EnableRDSHUserDataVhd" this:EnableRDSHUserDataVhd.ApplyOnServers="True" this:EnableRDSHUserDataVhd.IncludeFileLocation="[{}]" this:EnableRDSHUserDataVhd.ExcludeFileLocation="[{}]" this:EnableRDSHUserDataVhd.IncludeFolderLocation="[{}]" this:EnableRDSHUserDataVhd.ExcludeFolderLocation="[{}]"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mpa="clr-namespace:Microsoft.PowerShell.Activities;assembly=Microsoft.PowerShell.Activities"
 xmlns:mpma="clr-namespace:Microsoft.PowerShell.Management.Activities;assembly=Microsoft.PowerShell.Management.Activities"
 xmlns:mpua="clr-namespace:Microsoft.PowerShell.Utility.Activities;assembly=Microsoft.PowerShell.Utility.Activities"
 xmlns:mrc="clr-namespace:Microsoft.RemoteDesktopServices.Common;assembly=Microsoft.RemoteDesktopServices.Management.Activities"
 xmlns:mrma="clr-namespace:Microsoft.RemoteDesktopServices.Management.Activities;assembly=Microsoft.RemoteDesktopServices.Management.Activities"
 xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System"
 xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
 xmlns:s="clr-namespace:System;assembly=mscorlib"
 xmlns:s1="clr-namespace:System;assembly=System.Core"
 xmlns:s2="clr-namespace:System;assembly=System"
 xmlns:s3="clr-namespace:System;assembly=System.ServiceModel"
 xmlns:s4="clr-namespace:System;assembly=System.ComponentModel.Composition"
 xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
 xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:sc="clr-namespace:System.Collections;assembly=mscorlib"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Core"
 xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System"
 xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel"
 xmlns:sd="clr-namespace:System.Diagnostics;assembly=System"
 xmlns:sm="clr-namespace:System.Management;assembly=System.Management"
 xmlns:sma="clr-namespace:System.Management.Automation;assembly=System.Management.Automation"
 xmlns:st="clr-namespace:System.Threading;assembly=mscorlib"
 xmlns:this="clr-namespace:Microsoft.RemoteDesktopServices.Workflow"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="CollectionAlias" Type="InArgument(x:String)">
      <x:Property.Attributes>
        <RequiredArgumentAttribute />
      </x:Property.Attributes>
    </x:Property>
    <x:Property Name="RemapMode" Type="InArgument(x:Int32)">
      <x:Property.Attributes>
        <RequiredArgumentAttribute />
      </x:Property.Attributes>
    </x:Property>
    <x:Property Name="DiskType" Type="InArgument(x:Int32)">
      <x:Property.Attributes>
        <RequiredArgumentAttribute />
      </x:Property.Attributes>
    </x:Property>
    <x:Property Name="DiskSize" Type="InArgument(x:Int64)">
      <x:Property.Attributes>
        <RequiredArgumentAttribute />
      </x:Property.Attributes>
    </x:Property>
    <x:Property Name="RDMSServer" Type="InArgument(x:String)">
      <x:Property.Attributes>
        <RequiredArgumentAttribute />
      </x:Property.Attributes>
    </x:Property>
    <x:Property Name="UserVhdShare" Type="InArgument(x:String)">
      <x:Property.Attributes>
        <RequiredArgumentAttribute />
      </x:Property.Attributes>
    </x:Property>
    <x:Property Name="ApplyOnServers" Type="InArgument(x:Boolean)" />
    <x:Property Name="IncludeFileLocation" Type="InArgument(s:String[])" />
    <x:Property Name="ExcludeFileLocation" Type="InArgument(s:String[])" />
    <x:Property Name="IncludeFolderLocation" Type="InArgument(s:String[])" />
    <x:Property Name="ExcludeFolderLocation" Type="InArgument(s:String[])" />
  </x:Members>
  <sap:VirtualizedContainerService.HintSize>747,3195</sap:VirtualizedContainerService.HintSize>
  <mva:VisualBasic.Settings>Assembly references and imported namespaces for internal implementation</mva:VisualBasic.Settings>
  <sap:WorkflowViewStateService.ViewState>
    <scg2:Dictionary x:TypeArguments="x:String, x:Object">
      <x:Boolean x:Key="ShouldExpandAll">False</x:Boolean>
      <x:Boolean x:Key="ShouldCollapseAll">True</x:Boolean>
    </scg2:Dictionary>
  </sap:WorkflowViewStateService.ViewState>
  <Sequence DisplayName="EnableRDSHUserDataVhd" sap:VirtualizedContainerService.HintSize="707,3155">
    <Sequence.Variables>
      <Variable x:TypeArguments="sma:PSDataCollection(sma:PSObject)" Name="rdshPool" />
      <Variable x:TypeArguments="x:String" Name="rdshFarmSetting" />
      <Variable x:TypeArguments="x:String" Name="userVhdSetting" />
      <Variable x:TypeArguments="mrma:UserDataVhdSetting" Name="userDataVhdSetting" />
      <Variable x:TypeArguments="sc:Hashtable" Default="[New Hashtable()]" Name="rdshFarmProperties" />
      <Variable x:TypeArguments="sma:PSDataCollection(sma:PSObject)" Name="null" />
      <Variable x:TypeArguments="sma:PSDataCollection(sma:PSObject)" Name="rdshPoolList" />
      <Variable x:TypeArguments="sma:PSDataCollection(sma:PSObject)" Name="shareAccessible" />
      <Variable x:TypeArguments="sma:PSDataCollection(sma:PSObject)" Name="cmdResult" />
      <Variable x:TypeArguments="x:String" Name="tempUserVHDShare" />
      <Variable x:TypeArguments="x:String" Name="policyXML" />
      <Variable x:TypeArguments="x:String" Name="shareName" />
      <Variable x:TypeArguments="x:String" Name="shareMachine" />
      <Variable x:TypeArguments="sma:PSDataCollection(sma:PSObject)" Name="shareEntries" />
      <Variable x:TypeArguments="x:Int64" Default="1073741824" Name="BytesInGB" />
    </Sequence.Variables>
    <sap:WorkflowViewStateService.ViewState>
      <scg2:Dictionary x:TypeArguments="x:String, x:Object">
        <x:Boolean x:Key="IsExpanded">True</x:Boolean>
      </scg2:Dictionary>
    </sap:WorkflowViewStateService.ViewState>
    <mpua:WriteVerbose DisplayName="Verbose: Input" sap:VirtualizedContainerService.HintSize="685,22" Message="[&quot;Alias: &quot; &amp; CollectionAlias]" />
    <Sequence DisplayName="Validate" sap:VirtualizedContainerService.HintSize="685,51">
      <Sequence.Variables>
        <Variable x:TypeArguments="x:String" Name="rdshCollection" />
      </Sequence.Variables>
      <sap:WorkflowViewStateService.ViewState>
        <scg2:Dictionary x:TypeArguments="x:String, x:Object">
          <x:Boolean x:Key="IsExpanded">False</x:Boolean>
          <x:Boolean x:Key="IsPinned">False</x:Boolean>
        </scg2:Dictionary>
      </sap:WorkflowViewStateService.ViewState>
      <mpa:GetWmiObject Amended="False" Class="Win32_RDSHCollection" DirectRead="False" DisplayName="GWMI: Pool" EnableAllPrivileges="False" Filter="[&quot;Alias = '&quot; &amp; CollectionAlias &amp; &quot;'&quot;]" sap:VirtualizedContainerService.HintSize="516,22" Impersonation="Impersonate" Namespace="ROOT\cimv2\rdms" PSAuthenticationLevel="PacketPrivacy" PSComputerName="[{RDMSServer}]" Result="[rdshPool]" />
      <If Condition="[rdshPool.Count &lt;&gt; 1]" DisplayName="CheckIfPoolExists" sap:VirtualizedContainerService.HintSize="516,51">
        <sap:WorkflowViewStateService.ViewState>
          <scg2:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg2:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <If.Then>
          <TerminateWorkflow sap:VirtualizedContainerService.HintSize="200,22" Reason="[String.Format(System.Globalization.CultureInfo.CurrentCulture, RDManagementResources.SpecifiedCollectionDoesNotExist, CollectionAlias)]" />
        </If.Then>
      </If>
      <Assign sap:VirtualizedContainerService.HintSize="516,60">
        <Assign.To>
          <OutArgument x:TypeArguments="mrma:UserDataVhdSetting">[userDataVhdSetting]</OutArgument>
        </Assign.To>
        <Assign.Value>
          <InArgument x:TypeArguments="mrma:UserDataVhdSetting">[RDSessionHostUserDataVhdUtility.GetUserDataVhdSetting(RDMSServer, CollectionAlias)]</InArgument>
        </Assign.Value>
      </Assign>
      <If Condition="[userDataVhdSetting.UserVhdEnabled]" DisplayName="CheckIfUvhdIsEnabled" sap:VirtualizedContainerService.HintSize="516,51">
        <sap:WorkflowViewStateService.ViewState>
          <scg2:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg2:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <If.Then>
          <TerminateWorkflow sap:VirtualizedContainerService.HintSize="200,22" Reason="[String.Format(System.Globalization.CultureInfo.CurrentCulture, RDManagementResources.UserDataVhdIsAlreadyEnabled, CollectionAlias)]" />
        </If.Then>
      </If>
      <If Condition="[(RemapMode &lt;&gt; 0) And ((IncludeFileLocation.Length + IncludeFolderLocation.Length) &lt;= 0)]" DisplayName="CheckIfIncludeFolderIsSpecified" sap:VirtualizedContainerService.HintSize="516,51">
        <sap:WorkflowViewStateService.ViewState>
          <scg2:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg2:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <If.Then>
          <TerminateWorkflow sap:VirtualizedContainerService.HintSize="200,22" Reason="[RDManagementResources.IncludeLocationNotSpecified]" />
        </If.Then>
      </If>
      <mpa:GetWmiObject Amended="False" Class="Win32_RDSHCollection" DirectRead="False" DisplayName="GWMI: Pool" EnableAllPrivileges="False" sap:VirtualizedContainerService.HintSize="242,22" Impersonation="Impersonate" Namespace="ROOT\cimv2\rdms" PSAuthenticationLevel="PacketPrivacy" PSComputerName="[{RDMSServer}]" Result="[rdshPoolList]" />
      <ForEach x:TypeArguments="sma:PSObject" DisplayName="ForEach&lt;PSObject&gt;" sap:VirtualizedContainerService.HintSize="516,540" Values="[rdshPoolList]">
        <sap:WorkflowViewStateService.ViewState>
          <scg2:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg2:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <ActivityAction x:TypeArguments="sma:PSObject">
          <ActivityAction.Argument>
            <DelegateInArgument x:TypeArguments="sma:PSObject" Name="pool" />
          </ActivityAction.Argument>
          <Sequence DisplayName="UVHDShareCheck" sap:VirtualizedContainerService.HintSize="486,432">
            <Sequence.Variables>
              <Variable x:TypeArguments="x:String" Name="tempFarmSetting" />
              <Variable x:TypeArguments="mrma:UserDataVhdSetting" Name="tempUvhdSetting" />
            </Sequence.Variables>
            <sap:WorkflowViewStateService.ViewState>
              <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                <x:Boolean x:Key="IsExpanded">False</x:Boolean>
                <x:Boolean x:Key="IsPinned">False</x:Boolean>
              </scg2:Dictionary>
            </sap:WorkflowViewStateService.ViewState>
            <Assign sap:VirtualizedContainerService.HintSize="464,60">
              <Assign.To>
                <OutArgument x:TypeArguments="mrma:UserDataVhdSetting">[tempUvhdSetting]</OutArgument>
              </Assign.To>
              <Assign.Value>
                <InArgument x:TypeArguments="mrma:UserDataVhdSetting">[RDSessionHostUserDataVhdUtility.GetUserDataVhdSetting(RDMSServer, CType(pool.Properties("Alias").Value, String))]</InArgument>
              </Assign.Value>
            </Assign>
            <If Condition="[String.Compare(tempUvhdSetting.UserVhdShare, UserVhdShare, True, System.Globalization.CultureInfo.InvariantCulture) = 0]" DisplayName="CheckIfUvhdShareIsAlreadyConfigured" sap:VirtualizedContainerService.HintSize="464,208">
              <sap:WorkflowViewStateService.ViewState>
                <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                  <x:Boolean x:Key="IsExpanded">False</x:Boolean>
                  <x:Boolean x:Key="IsPinned">False</x:Boolean>
                </scg2:Dictionary>
              </sap:WorkflowViewStateService.ViewState>
              <If.Then>
                <TerminateWorkflow sap:VirtualizedContainerService.HintSize="200,22" Reason="[RDManagementResources.UserVhdShareIsAlreadyConfigured]" />
              </If.Then>
            </If>
          </Sequence>
        </ActivityAction>
      </ForEach>
      <Assign sap:VirtualizedContainerService.HintSize="516,60">
        <Assign.To>
          <OutArgument x:TypeArguments="x:String">[tempUserVHDShare]</OutArgument>
        </Assign.To>
        <Assign.Value>
          <InArgument x:TypeArguments="x:String">[UserVhdShare]</InArgument>
        </Assign.Value>
      </Assign>
    </Sequence>
    <mpua:WriteVerbose DisplayName="Verbose: Validation Done" sap:VirtualizedContainerService.HintSize="685,22" Message="Validation Succeeded" />
    <Sequence DisplayName="CreateTemplateVhd" sap:VirtualizedContainerService.HintSize="685,528">
      <Sequence.Variables>
        <Variable x:TypeArguments="x:String" Name="templateVhdPath" />
        <Variable x:TypeArguments="x:String" Name="scriptPath" />
        <Variable x:TypeArguments="x:Int64" Name="scriptDiskSize" />
        <Variable x:TypeArguments="x:String" Name="scriptDiskType" />
        <Variable x:TypeArguments="x:Int32" Default="0" Name="uvhdTemplateResult" />
      </Sequence.Variables>
      <sap:WorkflowViewStateService.ViewState>
        <scg2:Dictionary x:TypeArguments="x:String, x:Object">
          <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          <x:Boolean x:Key="IsPinned">True</x:Boolean>
        </scg2:Dictionary>
      </sap:WorkflowViewStateService.ViewState>
      <Assign sap:VirtualizedContainerService.HintSize="242,60">
        <Assign.To>
          <OutArgument x:TypeArguments="x:String">[templateVhdPath]</OutArgument>
        </Assign.To>
        <Assign.Value>
          <InArgument x:TypeArguments="x:String">[UserVhdShare &amp; "\UVHD-Template.vhdx"]</InArgument>
        </Assign.Value>
      </Assign>
      <Assign sap:VirtualizedContainerService.HintSize="242,60">
        <Assign.To>
          <OutArgument x:TypeArguments="x:Int64">[scriptDiskSize]</OutArgument>
        </Assign.To>
        <Assign.Value>
          <InArgument x:TypeArguments="x:Int64">[DiskSize \ BytesInGB]</InArgument>
        </Assign.Value>
      </Assign>
      <TryCatch sap:VirtualizedContainerService.HintSize="1147,1216">
        <TryCatch.Try>
          <Assign sap:VirtualizedContainerService.HintSize="242,60">
            <Assign.To>
              <OutArgument x:TypeArguments="x:Int32">[uvhdTemplateResult]</OutArgument>
            </Assign.To>
            <Assign.Value>
              <InArgument x:TypeArguments="x:Int32">[RDSessionHostUserDataVhdUtility.CreateUserDiskTemplate(RDMSServer, CollectionAlias, UserVhdShare, scriptDiskSize)]</InArgument>
            </Assign.Value>
          </Assign>
        </TryCatch.Try>
        <TryCatch.Catches>
          <Catch x:TypeArguments="s:Exception" sap:VirtualizedContainerService.HintSize="490,21">
            <ActivityAction x:TypeArguments="s:Exception">
              <ActivityAction.Argument>
                <DelegateInArgument x:TypeArguments="s:Exception" Name="exception" />
              </ActivityAction.Argument>
              <TerminateWorkflow sap:VirtualizedContainerService.HintSize="200,22" Reason="[exception.Message]" />
            </ActivityAction>
          </Catch>
        </TryCatch.Catches>
      </TryCatch>
    </Sequence>
    <mpua:WriteVerbose DisplayName="Verbose: Validation Done" sap:VirtualizedContainerService.HintSize="685,22" Message="Created Template Vhd" />
    <Sequence DisplayName="UpdateUvhdSetting" sap:VirtualizedContainerService.HintSize="685,2124">
      <Sequence.Variables>
        <Variable x:TypeArguments="x:Boolean" Default="False" Name="tempResult" />
        <Variable x:TypeArguments="sma:PSDataCollection(sma:PSObject)" Name="rdshServerList" />
      </Sequence.Variables>
      <sap:WorkflowViewStateService.ViewState>
        <scg2:Dictionary x:TypeArguments="x:String, x:Object">
          <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          <x:Boolean x:Key="IsPinned">True</x:Boolean>
        </scg2:Dictionary>
      </sap:WorkflowViewStateService.ViewState>
      <Assign sap:VirtualizedContainerService.HintSize="663,60">
        <Assign.To>
          <OutArgument x:TypeArguments="x:String">[policyXML]</OutArgument>
        </Assign.To>
        <Assign.Value>
          <InArgument x:TypeArguments="x:String">[RDSessionHostUserDataVhdUtility.BuildPolicyXml(RemapMode, IncludeFileLocation, IncludeFolderLocation, ExcludeFileLocation, ExcludeFolderLocation)]</InArgument>
        </Assign.Value>
      </Assign>
      <Assign sap:VirtualizedContainerService.HintSize="663,60">
        <Assign.To>
          <OutArgument x:TypeArguments="x:Boolean">[tempResult]</OutArgument>
        </Assign.To>
        <Assign.Value>
          <InArgument x:TypeArguments="x:Boolean">[RDSessionHostUserDataVhdUtility.SetUserDataVhdSetting(RDMSServer, CollectionAlias, True, tempUserVHDShare, policyXML, DiskSize, DiskType)]</InArgument>
        </Assign.Value>
      </Assign>
      <If Condition="[tempResult = False]" sap:VirtualizedContainerService.HintSize="663,208">
        <sap:WorkflowViewStateService.ViewState>
          <scg2:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsPinned">True</x:Boolean>
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg2:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <If.Then>
          <TerminateWorkflow sap:VirtualizedContainerService.HintSize="200,22" Reason="[RDManagementResources.UnableToSetUVHDSettings]" />
        </If.Then>
      </If>
      <mpua:WriteVerbose DisplayName="Verbose: Updated Collection Level settings" sap:VirtualizedContainerService.HintSize="663,22" Message="Updated settings for RDSH Collection" />
      <If Condition="[ApplyOnServers = true]" sap:VirtualizedContainerService.HintSize="663,1490">
        <sap:WorkflowViewStateService.ViewState>
          <scg2:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsPinned">True</x:Boolean>
          </scg2:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <If.Then>
          <Sequence DisplayName="Update Settings on RDSH servers" sap:VirtualizedContainerService.HintSize="538,1382">
            <sap:WorkflowViewStateService.ViewState>
              <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                <x:Boolean x:Key="IsPinned">True</x:Boolean>
              </scg2:Dictionary>
            </sap:WorkflowViewStateService.ViewState>
            <mpa:GetWmiObject Amended="False" Class="Win32_RDSHServer" DirectRead="False" DisplayName="GWMI: RDSHServers" EnableAllPrivileges="False" Filter="[&quot;CollectionAlias = '&quot; &amp; CollectionAlias &amp; &quot;'&quot;]" sap:VirtualizedContainerService.HintSize="516,22" Impersonation="Impersonate" Namespace="ROOT\cimv2\rdms" PSAuthenticationLevel="PacketPrivacy" PSComputerName="[{RDMSServer}]" Result="[rdshServerList]" />
            <ParallelForEach x:TypeArguments="sma:PSObject" DisplayName="ParallelForEach&lt;PSObject&gt;" sap:VirtualizedContainerService.HintSize="516,1134" Values="[rdshServerList]">
              <sap:WorkflowViewStateService.ViewState>
                <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                  <x:Boolean x:Key="IsPinned">True</x:Boolean>
                  <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                </scg2:Dictionary>
              </sap:WorkflowViewStateService.ViewState>
              <ActivityAction x:TypeArguments="sma:PSObject">
                <ActivityAction.Argument>
                  <DelegateInArgument x:TypeArguments="sma:PSObject" Name="rdshServer" />
                </ActivityAction.Argument>
                <Sequence sap:VirtualizedContainerService.HintSize="486,1026">
                  <Sequence.Variables>
                    <Variable x:TypeArguments="x:String" Name="ServerName" />
                    <Variable x:TypeArguments="sma:PSDataCollection(sma:ErrorRecord)" Name="Errors" />
                    <Variable x:TypeArguments="x:String" Name="ShortServerName" />
                    <Variable x:TypeArguments="x:String" Name="ShortShareMachineName" />
                    <Variable x:TypeArguments="x:String" Name="variable1" />
                    <Variable x:TypeArguments="x:String" Name="LocalSharePath" />
                  </Sequence.Variables>
                  <sap:WorkflowViewStateService.ViewState>
                    <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                      <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                      <x:Boolean x:Key="IsPinned">True</x:Boolean>
                    </scg2:Dictionary>
                  </sap:WorkflowViewStateService.ViewState>
                  <Assign sap:VirtualizedContainerService.HintSize="464,60">
                    <Assign.To>
                      <OutArgument x:TypeArguments="sma:PSDataCollection(sma:ErrorRecord)">[Errors]</OutArgument>
                    </Assign.To>
                    <Assign.Value>
                      <InArgument x:TypeArguments="sma:PSDataCollection(sma:ErrorRecord)">[New PSDataCollection(Of ErrorRecord)]</InArgument>
                    </Assign.Value>
                  </Assign>
                  <Assign sap:VirtualizedContainerService.HintSize="464,60">
                    <Assign.To>
                      <OutArgument x:TypeArguments="x:String">[ServerName]</OutArgument>
                    </Assign.To>
                    <Assign.Value>
                      <InArgument x:TypeArguments="x:String">[CType(rdshServer.Properties("Name").Value, String)]</InArgument>
                    </Assign.Value>
                  </Assign>
                  <Assign sap:VirtualizedContainerService.HintSize="464,60">
                    <Assign.To>
                      <OutArgument x:TypeArguments="x:String">[ShortServerName]</OutArgument>
                    </Assign.To>
                    <Assign.Value>
                      <InArgument x:TypeArguments="x:String">[Microsoft.RemoteDesktopServices.Common.CommonUtility.GetNetbiosNameFromJoinedNode(RDMSServer, ServerName)]</InArgument>
                    </Assign.Value>
                  </Assign>
                  <Assign sap:VirtualizedContainerService.HintSize="464,60">
                    <Assign.To>
                      <OutArgument x:TypeArguments="x:String">[ShortShareMachineName]</OutArgument>
                    </Assign.To>
                    <Assign.Value>
                      <InArgument x:TypeArguments="x:String">[Microsoft.RemoteDesktopServices.Common.CommonUtility.GetNetbiosNameFromLiveComputer(shareMachine)]</InArgument>
                    </Assign.Value>
                  </Assign>
                  <If Condition="[String.Compare(ShortServerName, ShortShareMachineName, StringComparison.OrdinalIgnoreCase) = 0]" sap:VirtualizedContainerService.HintSize="464,208">
                    <sap:WorkflowViewStateService.ViewState>
                      <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                        <x:Boolean x:Key="IsPinned">True</x:Boolean>
                        <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                      </scg2:Dictionary>
                    </sap:WorkflowViewStateService.ViewState>
                    <If.Then>
                      <mpa:InlineScript Command="import-module $env:windir\System32\ServerManagerInternal\rdmanagement;&#xA;Set-RDSHUserDataVHD -SessionHostServers $using:ServerName -UserVhdShare $using:UserVhdShare -UserPolicyXML $using:policyXML" sap:VirtualizedContainerService.HintSize="200,51" PSError="[Errors]" />
                    </If.Then>
                    <If.Else>
                      <mpa:InlineScript Command="import-module $env:windir\System32\ServerManagerInternal\rdmanagement;&#xA;Set-RDSHUserDataVHD -SessionHostServers $using:ServerName -UserVhdShare $using:tempUserVHDShare -UserPolicyXML $using:policyXML" sap:VirtualizedContainerService.HintSize="200,51" PSError="[Errors]" />
                    </If.Else>
                  </If>
                  <If Condition="[Errors.Count &gt; 0]" sap:VirtualizedContainerService.HintSize="464,254">
                    <sap:WorkflowViewStateService.ViewState>
                      <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                        <x:Boolean x:Key="IsPinned">True</x:Boolean>
                        <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                      </scg2:Dictionary>
                    </sap:WorkflowViewStateService.ViewState>
                    <If.Then>
                      <Sequence sap:VirtualizedContainerService.HintSize="222,146">
                        <sap:WorkflowViewStateService.ViewState>
                          <scg2:Dictionary x:TypeArguments="x:String, x:Object">
                            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                            <x:Boolean x:Key="IsPinned">True</x:Boolean>
                          </scg2:Dictionary>
                        </sap:WorkflowViewStateService.ViewState>
                        <mpua:WriteError DisplayName="Write-Error" sap:VirtualizedContainerService.HintSize="200,22" Message="[Errors.Item(0).Exception.Message]" />
                      </Sequence>
                    </If.Then>
                  </If>
                </Sequence>
              </ActivityAction>
            </ParallelForEach>
            <mpua:WriteVerbose DisplayName="Verbose: Updated RDSH Servers" sap:VirtualizedContainerService.HintSize="516,22" Message="Updated RDSH Servers" />
          </Sequence>
        </If.Then>
      </If>
    </Sequence>
    <mpua:WriteVerbose DisplayName="Verbose: Done" sap:VirtualizedContainerService.HintSize="685,22" Message="User Data VHD is enabled." />
  </Sequence>
</Activity>
