Image Portability Service PowerShell examples
Image Portability Service provides you a group of PowerShell Cmdlets to automate the workflow in export, upload and prepare phases.
Prerequisites
The PowerShell modules “Citrix.Workloads.Portability” and “Citrix.Image.Uploader” are required. You can install these modules from PSGallery.
Install the modules:
Install-Module -Name "Citrix.Workloads.Portability","Citrix.Image.Uploader"
<!--NeedCopy-->
Verify that the required modules are installed:
Get-Module -ListAvailable "Citrix.Workloads.Portability","Citrix.Image.Uploader"
<!--NeedCopy-->
Once the module has been installed, run Get-Help <name of cmdlet> -Full
to obtain help for specific cmdlets. For example:
Get-Help Start-IpsVsphereExportJob -Full
<!--NeedCopy-->
If you see errors when running the PowerShell scripts relating to a missing or old version of PowerShellGet, you may need to install the latest version as follows:
Install-Module -Name PowerShellGet -Force -Scope CurrentUser -AllowClobber
<!--NeedCopy-->
Common Options
The Image Portability Service PowerShell cmdlets all support some common options:
-
-DryRun=$true
This option tests credentials and validates settings to the extent that is possible without creating host resources -
-Debug
This option will increase the verbosity of certain low level operations in cases to aid debugging when unexplained failures occur
Credential management PowerShell examples
For a comprehensive list of options and examples, you can run each Image Portability Service PowerShell cmdlet with the -Help
option.
Adding a new credential
Credential for Azure:
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = 'Azure'
CredentialId = 'id of credential to be created'
AzureClientId = 'Azure service principal client ID'
AzureSecret = 'Azure service principal secret'
AzureTenantId = 'Azure tenant ID'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
New-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Credential for AWS:
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = 'Aws'
CredentialId = 'id of credential to be created'
AwsKeyId = 'AWS access key ID'
AwsKey = 'AWS secret access key'
AwsSessionToken = '<optional> AWS temporary credential session token'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
New-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Credential for Google Cloud Platform:
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = 'Gcp'
CredentialId = 'id of credential to be created'
GcpServiceAccountKeyFile = 'local path of your google cloud service account key file'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
New-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Credential for Vsphere, AHV, XenServer, or SMB file share server:
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = 'UsernamePassword'
CredentialId = 'id of credential to be created'
UserDomain = 'your user domain'
UserName = 'your user name'
UserPassword = 'your user password'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
New-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Modifying a credential
Credential for Azure:
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = 'Azure'
CredentialId = 'id of credential to be created'
AzureClientId = 'Azure service principal client ID'
AzureSecret = 'Azure service principal secret'
AzureTenantId = 'Azure tenant ID'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
Set-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Credential for Google Cloud Platform:
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = 'Gcp'
CredentialId = 'id of credential to be created'
GcpServiceAccountKeyFile = 'local path of your google cloud service account key file'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
Set-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Credential for Vsphere, AHV, XenServer, or SMB file share server:
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = 'UsernamePassword'
CredentialId = 'id of credential to be created'
UserDomain = 'your user domain'
UserName = 'your user name'
UserPassword = 'your user password'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
Set-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Listing credentials
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialType = '<optional> type of credential (Azure, Gcp or UsernamePassword) (list all credentials if not given)'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
Get-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Deleting a credential
$Params = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
CredentialId = 'id of credential to be daleted'
LogFileName = '<optional> log file name (default: Credentials.log)'
}
Remove-IpsCredentials @Params [-OverwriteLog]
<!--NeedCopy-->
Notes
The switch parameters in the cmdlet are provided as optional settings:
-OverwriteLog
: Overwrite the log content instead of appending it in the log file (same for image portablity workflow cmdlets)
Image Portability workflow PowerShell examples
Export from Vsphere
$ExportParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
VsphereCwSecretId = 'vsphere credential wallet ID'
VsphereHost = 'hostname.domain.com'
VspherePort = '<optional> port of vsphere host (default: 443)'
VsphereSslCaCertificateFilePath = '<optional> the file path of certificate'
VsphereSslCaCertificate = '<optional> certificate string'
VsphereSslNoCheckHostname = '<optional> boolean if not to check the host name (default $false)'
VsphereDataCenter = 'data center name'
VsphereDataStore = 'data store name'
VsphereResourcePool = '<optional> resource_pool_name (default: Resources)'
VsphereNetwork = 'VM Network'
VsphereHostSystem = '<optional> if specified the Export job will be executed by the Host specified in this field'
VsphereCluster = '<optional> if specified the Export job will be executed by the Cluster specified in this field'
SourceDiskName = "ds:///vmfs/volumes/5b916afa-1cb036d4-622f-0025b50a01cf/folder/disk.vmdk"
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: ExportVsphereToSmb.log)'
}
Start-IpsVsphereExportJob @ExportParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Prepare image on Vsphere
$PrepareParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
ProvisioningType = "Pvs" # (string, required) 'provisioning type (Mcs or Pvs)'
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $false # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallPvs = '2311' # (string, optional, default $null) version of the PVS server the image will be used with, for example 2206, 7.33, or 2203cu1 (required if provisioning type is PVS)'
ForceMisa = $false # (boolean, optional, default $false) if install latest MISA, overwriting existing version'
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
VsphereCwSecretId = 'vsphere credential wallet ID'
VsphereHost = 'hostname.domain.com'
VspherePort = '<optional> port of vsphere host (default: 443)'
VsphereSslCaCertificateFilePath = '<optional> the file path of certificate'
VsphereSslCaCertificate = '<optional> certificate string'
VsphereSslNoCheckHostname = '<optional> boolean if not to check the host name (default $false)'
VsphereDataCenter = 'data center name'
VsphereDataStore = 'data store name'
VsphereResourcePool = '<optional> resource_pool_name (default: Resources)'
VsphereNetwork = 'VM Network'
VsphereHostSystem = '<optional> if specified the Export job will be executed by the Host specified in this field'
VsphereCluster = '<optional> if specified the Export job will be executed by the Cluster specified in this field'
SourceDiskName = "ds:///vmfs/volumes/5b916afa-1cb036d4-622f-0025b50a01cf/folder/disk.vmdk"
Timeout = '<optional> timeout of proceeding image job in second (default: 3600)'
LogFileName = '<optional> log file name (default: PrepareAzure.log)'
}
Start-IpsVspherePrepareJob @PrepareParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Publish from Vsphere to PVS
Note: The cmdlet Start-IpsVspherePublishJob is the alias of cmdlet Start-IpsVsphereExportJob. They are using the same set of parameters as input. You need to specify the right information for publish workflow.
$PublishParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
VsphereCwSecretId = 'vsphere credential wallet ID'
VsphereHost = 'hostname.domain.com'
VspherePort = '<optional> port of vsphere host (default: 443)'
VsphereSslCaCertificateFilePath = '<optional> the file path of certificate'
VsphereSslCaCertificate = '<optional> certificate string'
VsphereSslNoCheckHostname = '<optional> boolean if not to check the host name (default $false)'
VsphereDataCenter = 'data center name'
VsphereDataStore = 'data store name'
VsphereResourcePool = '<optional> resource_pool_name (default: Resources)'
VsphereNetwork = 'VM Network'
VsphereHostSystem = '<optional> if specified the Export job will be executed by the Host specified in this field'
VsphereCluster = '<optional> if specified the Export job will be executed by the Cluster specified in this field'
SourceDiskName = "ds:///vmfs/volumes/5b916afa-1cb036d4-622f-0025b50a01cf/folder/disk.vmdk"
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = 'AzurePublish.log'
}
Start-IpsVspherePublishJob @PublishParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
About Vsphere SSL CA Certificate
The CA certificate (a digital certificate issued by a certificate authority) to validate trust for signed vCenter certificates. For more information on downloading the certificate, see the article on the VMware site.
You can either use the local file path VsphereSslCaCertificateFilePath
or the string type certificate VsphereSslCaCertificate
as input. If both are given, the cmdlet accepts the file path by default.
Format for the field VsphereSslCaCertificate
must be in the form:
-----BEGIN CERTIFICATE-----\n<Paste CA certificate here>\n-----END CERTIFICATE-----\n
<!--NeedCopy-->
Format the certificate without spaces or line breaks between the \n
characters.
Export from AHV
$ExportParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
CwSecretId = 'AHV credential wallet ID'
PrismHost = 'hostname.example.com' # (string, required) fully qulified hostname of the AHV server
PrismPort = 9440 # (integer, optional) port to connect to the AHV server at.
PrismSslCaCertificateFilePath = '<optional> the file path of certificate'
PrismSslCaCertificate = '<optional> certificate string'
PrismSslFingerprint = '<optional> fingerprint of the Prism SSL certificate (alternative to PrismSslCaCertificate )'
PrismSslNoCheckHostname = $False # (boolean, optional, default $false) if set, do to check the host name when validating SSL
ClusterUuid = 'UUID of cluster where the source image or virtual machine resides '
SubnetUuid = 'UUID of subnet of the Nutanix system to use for the export'
SourceImageUuid = "<optional> UUID of the image on the Prism server that will be exported (either SourceImageUuid or SourceVmUuid must be provided)"
SourceVmUuid = "<optional> UUID of the virtual machine on the Prism server that will be exported (either SourceImageUuid or SourceVmUuid must be provided)"
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: ExportAhvToSmb.log)'
}
Start-IpsAhvExportJob @ExportParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Prepare image on AHV
$PrepareParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
ProvisioningType = 'Mcs' # (string, required) provisioning type (MCS or PVS)
CwSecretId = 'prism-creds' # (string, required) credential wallet ID
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $true # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallMcsio = $false # (boolean, optional, default $false) if set install MCSIO
ForceMisa = $false # (boolean, optional, default $false) if set install latest MISA, overwriting existing version'
InstallUpl = $false # (boolean, optional, default $false) if set install User Profile Layer
Chkdsk = $false # (boolean, optional, default $false) if set, run the chkdsk utility against the target image during preperation
Defrag = $True # (boolean, optional, default $false) if set, run the defrag utility against the target image during preparation
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
OutputImageName = 'Marketing Desktop' # (string) name to give to the prepared image
PrismHost = 'hostname.example.com' # (string, required) fully qulified hostname of the AHV server
PrismPort = 9440 # (integer, optional) port to connect to the AHV server at.
PrismSslNoCheckHostname = $False # (boolean, optional, default $false) if set, do to check the host name when validating SSL
SourceImageUuid = '123e4567-e89b-12d3-a456-426655440000' # (string, required) The UUID of the image to prepare
ClusterUuid = 'd0659a72-5087-11ed-bdc3-0242ac120002' # (string, required) The UUID of the cluster where the image will be prepared
SubnetUuid = 'd7880448-5087-11ed-bdc3-0242ac120002' # (string, required) The UUID of the nework the preparation VM will be attached to.
Prefix = 'acme' # (string, optional, default "ce") string to prefix created assets with
Timeout = 7200 # (integer, optional, default 7200) fail the job if the timeout is reached
LogFileName = '.\PrepareAhv.log' # (string, optional, default "PrepareAhv.log") name of file where job logging will be written
}
Start-IpsAhvPrepareJob @PrepareParams -Force -OverwriteLog -Verbose | Wait-IpsJob
<!--NeedCopy-->
About AHV SSL CA Certificate
The CA certificate (a digital certificate issued by a certificate authority) to validate trust for signed AHV certificates.
You can either use the local file path PrismSslCaCertificateFilePath
or the string type certificate PrismSslCaCertificate
as input. If both are given, the cmdlet accepts the file path by default.
Format for the field PrismSslCaCertificate
must be in the form:
-----BEGIN CERTIFICATE-----\n<Paste CA certificate here>\n-----END CERTIFICATE-----\n
<!--NeedCopy-->
Format the certificate without spaces or line breaks between the \n
characters.
Export from XenServer
$ExportParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
CwSecretId = 'Xen credential wallet ID'
XenHost = 'hostname.domain.com'
XenPort = '<optional> port of XenServer host (default: 443)'
XenSslFingerprint = '<optional> fingerprint of the XenServer SSL certificate'
Network = 'name of the XenServer network to use for the export'
SourceDiskUuid = "UUID of virtual disk on the XenServer that will be exported"
StorageRepositoryUuid = "UUID of the XenServer storage repository to use for the export"
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: ExportXenToSmb.log)'
}
Start-IpsXenExportJob @ExportParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Export from Azure
$ExportParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
AzureSubscriptionId = 'Azure subscription ID'
CloudCwSecretId = 'Azure credential wallet ID'
AzureLocation = '<optional> Azure location (default: eastus)'
TargetResourceGroup = 'target resource group name'
AzureVirtualNetworkResourceGroupName = 'Azure vnet resource group name'
AzureVirtualNetworkName = 'Azure vnet name'
AzureVirtualNetworkSubnetName = 'Azure subnet name'
CloudDiskName = 'disk-name'
AzureVmResourceGroup = '<optional> resource group name of vm'
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: ExportAzureToSmb.log)'
}
Start-IpsAzureExportJob @ExportParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
About Azure location
The parameter AzureLocation
in all cmdlet examples on Azure requires a standard format of Azure region code name. For more information on searching the region code name, see the article on the Azure site.
Export from Amazon Web Services
$ExportParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
CloudCwSecretId = 'AHV credential wallet ID'
AwsRegion = 'us-east4-a' # (string, required) the AWS region where the export will take place
AwsVolumeId = 'vol-0aa1d07ceb4c41301' # (string, required) the id of the EC2 EBS volume to be exported
AwsSubnetId = 'subnet-0bc58fcc26cceee22' # (string, required) the subnet id in AWS where the export appliance will be created
AwsSecurityGroupIds = 'sg-060293a7964c725dd','sg-9e872fc8131e43298' # (string[], optional) array of security groups to attach to the network interface of the export appliance VM
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
Deployment = '<optional> IPS host endpoint: api-<geo>.cloud.com/ips (<geo> must be one of us, ap-s or eu) (default: api-us.cloud.com/ips)'
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: ExportAhvToSmb.log)'
}
Start-IpsAwsExportJob @ExportParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Export from Google Cloud Platform
$ExportParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
CloudCwSecretId = 'Google Cloud credential wallet ID'
GcpZone = 'us-east4-a'
VpcNetworkName = 'networkname'
VpcNetworkSubnetName = '<optional> regions/us-east4/subnetworks/subnetname'
NetworkTags = '<optional> an array of network tags'
PrepareDiskName = 'output-disk-name'
AzureVmResourceGroup = '<optional> resource group name of vm'
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: ExportGcpToSmb.log)'
}
Start-IpsGcpExportJob @ExportParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Upload to AWS
$UploaderParams = @{
Region = 'us-east-1' # (string, optional) Specifies the AWS region to create the snapshot in.
ProfileName = 'ips' # (string, required) Specifies the name of a profile containing the AWS credentials to use.
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
FileName = "\\smb.example.com\share\folder\disk.vhdx" # (string, required) Filename of the disk to upload. May be a local path or a UNC path to a SMB file share.
}
$snapshotId = Copy-DiskToAWS @UploaderParams [-Force] [-OverwriteLog] [-Install] [-Verbose]
<!--NeedCopy-->
Upload to Azure
$UploaderParams = @{
SubscriptionId = '11111111-2222-3333-4444-555555555555' # (guid, required) id of the subscription that contains the resource group where the uploaded disk will be created
Location = 'eastus' # (string, required) Azure location where the disk will be created
ResourceGroup = 'MyResourcegroup' # (string, required) the Azure resource group where the uploaded disk will be created
ManagedDiskName = 'MyDisk' # (string, required) the name to give to the Azure managed disk that is the result of the upload
FileName = "\\smb.example.com\share\folder\disk.vhdx" # (string, required) Filename of the disk to upload. May be a local path or a UNC path to a SMB file share.
}
Copy-DiskToAzure @UploaderParams [-Force] [-OverwriteLog] [-Install] [-Verbose]
<!--NeedCopy-->
Creates an EBS snapshot from the disk in the region specified by the -AwsRegion parameter if supplied else the default region, and upon success returns the snapshot ID.
The recommended practice for AWS credential handling is followed and AWS credentials are obtained from a profile stored in a local credential store. For more information see Specifying Your AWS Credentials. The profile to use is specified through the -AwsProfileName parameter. If not specified, the default profile is used.
Upload to Google Cloud Platform
$UploaderParams = @{
ImageName = "finance-win10-gold" # (string, required) name to give to the image that will be created in GCP from the uploaded disk
ServiceAccountKeyFile = "C:\Users\JohnSmith\Documents\google.json" # (string, required) Path to the GCP keyfile to use for the upload
FileName = "\\smb.example.com\share\folder\disk.vhdx" # (string, required) Filename of the disk to upload. May be a local path or a UNC path to a SMB file share.
}
Copy-DiskToGCP @UploaderParams [-Force] [-OverwriteLog] [-Install] [-Verbose]
<!--NeedCopy-->
Upload to Nutanix
$UploaderParams = @{
host = 'ahv.example.com' # (string, required) hostname of Nutanix server where the uploaded disk will be stored
Username = "admin" # (string, required) username to use when accessing the Nutanix server
Password = "YourPassword" # (string, required) password to use when accessing the Nutanix server
Name = "YourDisk" # (string, required) name to give to the uploaded disk
Description = "Engineering golden image" # (string, required) name to give to the uploaded disk
FileName = "\\smb.example.com\share\folder\disk.vhdx" # (string, required) Filename of the disk to upload. May be a local path or a UNC path to a SMB file share.
}
Copy-DiskToAHV @UploaderParams
<!--NeedCopy-->
Upload to XenServer
$UploaderParams = @{
host = 'xs.example.com' # (string, required) hostname of XenServer host where the uploaded disk will be stored
Username = "admin" # (string, required) username to use when accessing the XenServer
Password = "YourPassword" # (string, required) password to use when accessing the XenServer
SrUuid = '11111111-2222-3333-4444-555555555555' # (guid, required) Specifies the UUID of the storage repository on the XenServer system where the uploaded image will be created.
Name = "YourDisk" # (string, required) name to give to the uploaded disk
Description = "Engineering golden image" # (string, required) name to give to the uploaded disk
FileName = "\\smb.example.com\share\folder\disk.vhdx" # (string, required) Filename of the disk to upload. May be a local path or a UNC path to a SMB file share.
}
Copy-DiskToXen @UploaderParams
<!--NeedCopy-->
Prepare image on Azure
$PrepareParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
CloudProvisioningType = "Mcs" # (string, required) 'provisioning type (Mcs or Pvs)'
CloudCwSecretId = 'Azure credential wallet ID'
CloudDiskName = 'disk name'
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $true # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallPvs = $null # (string, optional, default $null) version of the PVS server the image will be used with, for example 2206, 7.33, or 2203cu1 (required if provisioning type is PVS)'
ForceMisa = $false # (boolean, optional, default $false) if install latest MISA, overwriting existing version'
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
AzureSubscriptionId = 'Azure subscription ID'
AzureLocation = 'eastus'
TargetResourceGroup = 'target resource group name'
AzureVirtualNetworkResourceGroupName = 'Azure vnet resource group name'
AzureVirtualNetworkName = 'Azure vnet name'
AzureVirtualNetworkSubnetName = 'Azure subnet name'
AzureVmResourceGroup = '<optional> resource group name of vm'
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 3600)'
LogFileName = '<optional> log file name (default: PrepareAzure.log)'
}
Start-IpsAzurePrepareJob @PrepareParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Publish from Azure to Azure PVS
Note: The cmdlet Start-IpsAzurePublishJob is the alias of cmdlet Start-IpsAzureExportJob. They are using the same set of parameters as input. You need to specify the right information for publish workflow.
$PublishParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
AzureSubscriptionId = 'Azure subscription ID'
CloudCwSecretId = 'Azure credential wallet ID'
AzureLocation = '<optional> Azure location (default: eastus)'
TargetResourceGroup = 'target resource group name'
AzureVirtualNetworkResourceGroupName = 'Azure vnet resource group name'
AzureVirtualNetworkName = 'Azure vnet name'
AzureVirtualNetworkSubnetName = 'Azure subnet name'
PrepareDiskName = 'output-disk-name'
AzureVmResourceGroup = '<optional> resource group name of vm'
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = 'AzurePublish.log'
}
Start-IpsAzurePublishJob @PublishParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Prepare image on Azure and publish it to a SMB Share
$PrepareAndPublishParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
CloudProvisioningType = "Pvs" # (string, required)'provisioning type (Mcs or Pvs)'
CloudCwSecretId = 'Azure credential wallet ID'
CloudDiskName = 'disk name'
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $true # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallPvs = $null # (string, optional, default $null) version of the PVS server the image will be used with, for example 2206, 7.33, or 2203cu1 (required if provisioning type is PVS)'
ForceMisa = $false # (boolean, optional, default $false) if install latest MISA, overwriting existing version'
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
AzureSubscriptionId = 'Azure subscription ID'
AzureLocation = 'eastus'
TargetResourceGroup = 'target resource group name'
AzureVirtualNetworkResourceGroupName = 'Azure vnet resource group name'
AzureVirtualNetworkName = 'Azure vnet name'
AzureVirtualNetworkSubnetName = 'Azure subnet name'
AzureVmResourceGroup = '<optional> resource group name of vm'
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: AzurePrepareAndPublish.log)'
}
Start-IpsAzurePrepareAndPublishJob @PrepareAndPublishParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Prepare image on Google Cloud Platform
$PrepareParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
CloudProvisioningType = "Pvs" # (string, required) provisioning type (Mcs or Pvs)
CloudCwSecretId = 'Google Cloud credential wallet ID'
CloudDiskName = 'disk name'
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $false # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallPvs = '1912CU9' # (string, optional, default $null) version of the PVS server the image will be used with, for example 2206, 7.33, or 2203cu1 (required if provisioning type is PVS)'
ForceMisa = $false # (boolean, optional, default $false) if install latest MISA, overwriting existing version'
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
GcpZone = 'us-east4-a'
VpcNetworkName = 'networkname'
VpcNetworkSubnetName = '<optional> regions/us-east4/subnetworks/subnetname'
NetworkTags = '<optional> an array of network tags'
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 3600)'
LogFileName = '<optional> log file name (default: PrepareGcp.log)'
}
Start-IpsGcpPrepareJob @PrepareParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Publish from Google Cloud Platform to Google Cloud Platform PVS
Note: The cmdlet Start-IpsGcpPublishJob is the alias of cmdlet Start-IpsGcpExportJob. They are using the same set of parameters as input. You need to specify the right information for publish workflow.
$PublishParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
CloudCwSecretId = 'Google Cloud credential wallet ID'
GcpZone = 'us-east4-a'
VpcNetworkName = 'networkname'
VpcNetworkSubnetName = '<optional> regions/us-east4/subnetworks/subnetname'
NetworkTags = '<optional> an array of network tags'
PrepareDiskName = 'output-disk-name'
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = 'GcpPublish.log'
}
Start-IpsGcpPublishJob @PublishParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Prepare image on Google Cloud Platform and publish it to a SMB Share
$PrepareAndPublishParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
CloudProvisioningType = "Mcs" # (string, required) provisioning type (Mcs or Pvs)
CloudCwSecretId = 'Google Cloud credential wallet ID'
CloudDiskName = 'disk name'
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $true # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallPvs = $null # (string, optional, default $null) version of the PVS server the image will be used with, for example 2311, 7.33, or 2203cu1 (required if provisioning type is PVS)'
ForceMisa = $false # (boolean, optional, default $false) if install latest MISA, overwriting existing version'
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
GcpZone = 'us-east4-a'
VpcNetworkName = 'networkname'
VpcNetworkSubnetName = '<optional> regions/us-east4/subnetworks/subnetname'
NetworkTags = '<optional> an array of network tags'
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
Tags = @{MyTagName = "MyTagValue"} # (hashtable, optional, default empty) custom tags to be added to all related resources
Timeout = '<optional> timeout of proceeding image job in second (default: 7200)'
LogFileName = '<optional> log file name (default: GcpPrepareAndPublish.log)'
}
Start-IpsGcpPrepareAndPublishJob @PrepareAndPublishParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Prepare image on Amazon Web Services
$PrepareParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
CloudProvisioningType = "Pvs" # (string, required) provisioning type (MCS or PVS)
CloudCwSecretId = 'AWS credential wallet ID'
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $false # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallPvs = '2311' # (string, optional, default $null) version of the PVS server the image will be used with, for example 2206, 7.33, or 2203cu1 (required if provisioning type is PVS)'
ForceMisa = $false # (boolean, optional, default $false) if install latest MISA, overwriting existing version'
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
AwsRegion = 'us-east4-a' # (string, required) the AWS region where the prepare will take place
AwsTargetSnapshotId = 'The name of the snapshot that was created when the image was uploaded'
AwsSubnetId = 'subnet-0bc58fcc26cceee22' # (string, required) the subnet id in AWS where the export appliance will be created
AwsSecurityGroupIds = 'sg-060293a7964c725dd','sg-9e872fc8131e43298' # (string[], optional) array of security groups to attach to the network interface of the export appliance VM
Deployment = '<optional> IPS host endpoint: api-<geo>.cloud.com/ips (<geo> must be one of us, ap-s or eu) (default: api-us.cloud.com/ips)'
Timeout = '<optional> timeout of proceeding image job in second (default: 3600)'
LogFileName = '<optional> log file name (default: PrepareGcp.log)'
}
Start-IpsAwsPrepareJob @PrepareParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
NOTE: Amazon Web Services authentication requires the user to setup a profile that is passed to the Copy-Disk commandlet. For more information on how to setup the profile, see the Using AWS Credentials article.
Create an AMI for MCS
This script is intended as an example. You will need to customize it to get full access to all the parameters available during AMI creation. This script requires the aws
CLI.
$ImageParams = @{
VolumeId = 'AWS Volume ID (from IpsAwsPrepareJob output artifacts)'
ImageName = '(optional) output name'
LogFileName = '<optional> log file name (default: PrepareGcp.log)'
}
New-IpsAwsImage @ImageParams [-Force] [-OverwriteLog] [-Verbose]
<!--NeedCopy-->
New-IpsAwsImage
can also accept artifacts from Prepare jobs on the pipeline:
Start-IpsAwsPrepareJob @PrepareParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob | New-IpsAwsImage -ImageName "ips-output-ami"
<!--NeedCopy-->
Prepare image on Citrix XenServer
$PrepareParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
ProvisioningType = 'Mcs' # (string, required) provisioning type (MCS or PVS)
CwSecretId = 'xen-creds' # (string, required) credential wallet ID
DomainUnjoin = $false # (boolean, optional, default $false) if set, remove domain from image. Removes joined domain from Windows image.
InstallMisa = $true # (boolean, optional, default $true) if set install MISA, required when the source provisioning type is PVS and the destination provisioning type is MCS
InstallMcsio = $false # (boolean, optional, default $false) if set install MCSIO
InstallPvs = $null # (string, optional, default $null) version of the PVS server the image will be used with, for example 2311, 7.33, or 2203cu1 (required if provisioning type is PVS)'
ForceMisa = $false # (boolean, optional, default $false) if set install latest MISA, overwriting existing version'
InstallUpl = $false # (boolean, optional, default $false) if set install User Profile Layer
Chkdsk = $false # (boolean, optional, default $false) if set run the chkdsk utility against the target image during preperation
XdReconfigure = @(
[pscustomobject]@{
ParameterName = 'controllers'
ParameterValue = 'The fully qualified domain name of your cloud connector'
}
)
StorageRepositoryUuid = '9496efec-cdf6-4019-a251-4ee57ab5643f' # (string, required) uuid of the storage repository on the XenServer where the target disk is stored
TargetDiskUuid = '123e4567-e89b-12d3-a456-426655440000' # (string, required) uuid of the target disk on the XenServer
XenHost = 'hostname.example.com' # (string, required) The fully qualified hostname of the XenServer
Network = 'VM Network' # (string, required) The network on the XenServer that the prepare VM will be attached to
Timeout = 7200 # (integer, optional, default: 7200) timeout of proceeding image job in second
LogFileName = 'PrepareXen.log' # (string, optional, default: PrepareXen.log) log file name
}
Start-IpsXenPrepareJob @PrepareParams [-Force] [-OverwriteLog] [-Verbose] | Wait-IpsJob
<!--NeedCopy-->
Notes
The switch parameters in the cmdlet are provided as optional settings:
-Force
: Override the target file instead of throwing exception if the file already exists
-OverwriteLog
: Overwrite the log content instead of appending it in the log file (same for credential management cmdlets)
-Verbose
: Write verbose message in the host
-Install
: Install the required dependencies instead of throwing exception if the required dependencies are missing (for upload cmdlet only)
For export and prepare phases, the example is a PowerShell pipeline to run the Start-Ips<*>Job
and Wait-IpsJob
cmdlets in a row connected by pipeline operator (|
). You can also run these cmdlets separately. Following is an example of running cmdlets seperately to export image from Vsphere to SMB file share server.
Initialize the configuration parameters in PowerShell:
$ExportParams = @{
CustomerId = 'a7f4wb1example' # (string, required) your citrix customer ID
SecureClientId = '7fed2a1e-1495-46b7-8fd3-5644764af395' # (string, required) your citrix secure client ID
SecureSecret = '9T.3Q~MGlnB6NNgpNUUWrcquVzODrdGK~eXampLe' # (string, required) your citrix secure secret
ResourceLocationId = '47251663-6710-4f76-854a-2385e3fe002d' # (string, required) citrix cloud resource ID guid
SmbLocation = "smb://smb.example.com/VHDs/Eng" # (string, required) URL of the SMB server storage location where the exported disk will be stored
SmbDiskName = "my-export" # (string, required) name of disk with no extension
SmbDiskFormat = "VhdDiskFormat" # (string, optional, default: VhdDiskFormat) format of disk (must be one of VhdDiskFormat or VhdxDiskFormat)
SmbCwId = "smb-cw-id" # (string, required) SMB credential wallet ID
VsphereCwSecretId = 'vsphere credential wallet ID'
VsphereHost = 'hostname.domain.com'
VsphereDataCenter = 'data center name'
VsphereDataStore = 'data store name'
VsphereNetwork = 'VM Network'
SourceDiskName = "ds:///vmfs/volumes/5b916afa-1cb036d4-622f-0025b50a01cf/folder/disk.vmdk"
}
<!--NeedCopy-->
The output example of Start-IpsVsphereExportJob
:
> Start-IpsVsphereExportJob @ExportParams
Logging to C:\path\to\logfile\ExportVsphereToSmb.log Verbose False
Authenticating for Citrix customer <your-citrix-customer-id> using API key <>.
Authenticated for Citrix customer <your-citrix-customer-id>.
Starting export workflow
***** Call Method: ExportImageJob overwrite: False *****
Image Export started with id <00000000-your-job-id-000000000000>
<!--NeedCopy-->
A new job ID <00000000-your-job-id-000000000000>
is generated and displayed at the end of output. This job ID and the Citrix customer ID must be used as two input parameters of Wait-IpsJob
, see:
Wait-IpsJob -CustomerId "<your-citrix-customer-id>" -JobId "<00000000-your-job-id-000000000000>"
<!--NeedCopy-->
Wait-IpsJob
can keep observing the job progress status until the job has been finished and final job status will be returned. Alternatively, you can also use the job ID to get the job status or cancel the in progress job via Jobs APIs.