Citrix Provisioning Services 7.7 PowerShell with Objects Programmer s Guide. Revision 1 November PDF

Please download to get full document.

View again

of 341
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Art

Published:

Views: 378 | Pages: 341

Extension: PDF | Download: 3

Share
Related documents
Description
Citrix Provisioning Services 7.7 PowerShell with Objects Programmer s Guide Revision 1 November 2015 Copyright and Trademark Notice Information in this document is subject to change without notice. Companies,
Transcript
Citrix Provisioning Services 7.7 PowerShell with Objects Programmer s Guide Revision 1 November 2015 Copyright and Trademark Notice Information in this document is subject to change without notice. Companies, names, and data used in examples herein are fictitious unless otherwise noted. Other than printing one copy for personal use, no part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Citrix Systems, Inc. Copyright Citrix Systems, Inc. All rights reserved. Citrix, ICA (Independent Computing Architecture), NetScaler, and Program Neighborhood are registered trademarks; Citrix Presentation Server, Citrix Access Essentials, Citrix Access Gateway, Citrix Password Manager, Citrix Application Firewall, Citrix Application Gateway, Citrix Provisioning Services, Citrix Streaming Profiler, Citrix Streaming Client, Citrix Streaming Service, Citrix EdgeSight, Citrix WANScaler, Citrix SmoothRoaming, Citrix Authorized Learning Center, Citrix Subscription Advantage, Citrix Technical Support, and Speed Screen are trademarks of Citrix Systems, Inc. in the United States and other countries. Copyright RSA Encryption RSA Security Inc. All rights reserved. 2 Table of Contents Introduction Using the PowerShell Programmer Interface with Objects Installation of PowerShell Snap-In Registration of McliPSSnapIn.dll using Import-Module Registration of Citrix.PVS.SnapIn.dll using Add-PSSnapin bit Registration bit Registration Alternative Registration of Citrix.PVS.SnapIn.dll in PowerShell bit Registration in PowerShell bit Registration in PowerShell Uninstall of PowerShell Snap-In Unregister of Citrix.PVS.SnapIn.dll bit Unregister bit Unregister Alternative Unregister of Citrix.PVS.SnapIn.dll in PowerShell bit Unregister in PowerShell bit Unregister in PowerShell Setup of the SOAP Server Communication Set-PvsConnection Command Specific Help Error Handling Short cmdlet list Cmdlet by Object Type Many AuthGroup Collection Device Disk DiskLocator Farm FarmView Server Site SiteView Store System Task UpdateTask Error codes Objects, in the Citrix.PVS.SnapIn Namespace PvsADAccount PvsAuditAction PvsAuditActionParameter PvsAuditActionProperty PvsAuditTrail PvsAuthGroup PvsAuthGroupUsage PvsCollection PvsConnection PvsDevice PvsDeviceBootstrap PvsDeviceBootstrapList PvsDeviceInfo PvsDevicePersonality PvsDevicePersonalityList PvsDeviceStatus PvsDisk PvsDiskInfo PvsDiskInventory PvsDiskLocator PvsDiskLocatorLock PvsDiskUpdateDevice PvsDiskUpdateStatus PvsDiskVersion PvsFarm PvsFarmView PvsGroup PvsLocalServer PvsNewDiskVersion PvsPhysicalAddress PvsServer PvsServerBiosBootstrap PvsServerBootstrap PvsServerBootstrapName PvsServerInfo PvsServerStatus PvsServerStore PvsSite PvsSiteView PvsStore PvsStoreSharedOrServerPath PvsTask PvsUndefinedDisk PvsUpdateTask PvsVersion PvsVirtualHostingPool PvsXDSite Cmdlets Add-PvsDeviceToDomain Add-PvsDeviceToView Add-PvsDiskLocatorToDevice Add-PvsDiskToUpdateTask Add-PvsDiskVersion Clear-PvsConnection Clear-PvsTask Copy-PvsDeviceProperties Copy-PvsDiskProperties Copy-PvsServerProperties Disable-PvsDeviceDiskLocator Dismount-PvsDisk Enable-PvsDeviceDiskLocator Export-PvsAuditTrail Export-PvsDisk Export-PvsOemLicenses Get-PvsADAccount Get-PvsAuditActionParameter Get-PvsAuditActionProperty Get-PvsAuditActionSibling Get-PvsAuditTrail Get-PvsAuthGroup Get-PvsAuthGroupUsage Get-PvsCollection Get-PvsConnection Get-PvsCreateDiskStatus Get-PvsDevice Get-PvsDeviceBootstrap Get-PvsDeviceCount Get-PvsDeviceDiskLocatorEnabled Get-PvsDeviceInfo Get-PvsDevicePersonality Get-PvsDeviceStatus Get-PvsDirectory Get-PvsDisk Get-PvsDiskInfo Get-PvsDiskInventory Get-PvsDiskLocator Get-PvsDiskLocatorCount Get-PvsDiskLocatorLock Get-PvsDiskUpdateDevice Get-PvsDiskUpdateStatus Get-PvsDiskVersion Get-PvsExists Get-PvsFarm Get-PvsFarmView Get-PvsGroup Get-PvsLocalServer Get-PvsMaintenanceVersionExists Get-PvsMinimumLastAutoAddDeviceNumber Get-PvsMountedDisk Get-PvsMountedDriveLetter Get-PvsNewDiskVersion Get-PvsServer Get-PvsServerBiosBootstrap Get-PvsServerBootstrap Get-PvsServerBootstrapName Get-PvsServerCount Get-PvsServerInfo Get-PvsServerName Get-PvsServerStatus Get-PvsServerStore Get-PvsServerStoreActiveDeviceCount Get-PvsSite Get-PvsSiteView Get-PvsStore Get-PvsStoreFreeSpace Get-PvsStoreSharedOrServerPath Get-PvsTask Get-PvsTaskStatus Get-PvsUndefinedDisk Get-PvsUpdateTask Get-PvsVersion Get-PvsVirtualHostingPool Get-PvsXDSite Grant-PvsAuthGroup Import-PvsDevices Import-PvsDisk Import-PvsOemLicenses Invoke-PvsActivateDeviceMAK Invoke-PvsMarkDown Invoke-PvsPromoteDiskVersion Invoke-PvsRebalanceDevices Invoke-PvsRevertDiskVersion Merge-PvsDisk Mount-PvsDisk Move-PvsDeviceToCollection Move-PvsServerToSite New-PvsAuthGroup New-PvsCollection New-PvsDevice New-PvsDeviceWithPersonalvDisk New-PvsDirectory New-PvsDiskLocator New-PvsDiskMaintenanceVersion New-PvsDiskUpdateDevice New-PvsFarmView New-PvsServer New-PvsSite New-PvsSiteView New-PvsStore New-PvsUpdateTask New-PvsVirtualHostingPool Remove-PvsAuthGroup Remove-PvsCollection Remove-PvsDevice Remove-PvsDeviceDiskCacheFile Remove-PvsDeviceFromDomain Remove-PvsDeviceFromView Remove-PvsDirectory Remove-PvsDiskFromUpdateTask Remove-PvsDiskLocator Remove-PvsDiskLocatorFromDevice Remove-PvsDiskUpdateDevice Remove-PvsDiskVersion Remove-PvsFarmView Remove-PvsServer Remove-PvsServerStore Remove-PvsSite Remove-PvsSiteView Remove-PvsStore Remove-PvsUpdateTask Remove-PvsVirtualHostingPool Reset-PvsDatabase Reset-PvsDeviceForDomain Restart-PvsStreamService Revoke-PvsAuthGroup Set-PvsAuthGroup Set-PvsCollection Set-PvsConnection Set-PvsDevice Set-PvsDeviceBootstrap Set-PvsDevicePersonality Set-PvsDisk Set-PvsDiskLocator Set-PvsDiskUpdateDevice Set-PvsDiskVersion Set-PvsFarm Set-PvsFarmView Set-PvsOverrideVersion Set-PvsServer Set-PvsServerBiosBootstrap Set-PvsServerBootstrap Set-PvsServerStore Set-PvsSite Set-PvsSiteView Set-PvsStore Set-PvsUpdateTask Set-PvsVirtualHostingPool Set-PvsXDSite Start-PvsAutoUpdate Start-PvsCreateDisk Start-PvsDeviceBoot Start-PvsDeviceReboot Start-PvsDeviceShutdown Start-PvsDisplayMessage Start-PvsStreamService Start-PvsUpdateTask Stop-PvsCreateDisk Stop-PvsStreamService Stop-PvsTask Stop-PvsUpdateTask Test-PvsDirectory Unlock-PvsAllDisk Unlock-PvsDisk Update-PvsBootPartitionBDM Update-PvsInventory Introduction Use Provisioning Services programming interfaces to manage your implementation from a command line or from scripts. Only users with correct administrative privileges can use programming commands. Non-administrators, that do not have elevated privileges and attempt to use these commands, will receive the Invalid access message. Four different programming interfaces exist: Management Command Line Interface (MCLI) Simple Object Access Protocol (SOAP) Server Programmer Interface PowerShell Programmer Interface with Objects PowerShell Programmer Interface (Deprecated) This document provides the information needed to use this interface. Using the PowerShell Programmer Interface with Objects Use the information that follows to manage a Provisioning Service s implementation from the PowerShell Interface with Objects. Installation of PowerShell Snap-In The PowerShell snap-in (Citrix.PVS.SnapIn.dll) can be installed using the Provisioning Server Console install. Registration of McliPSSnapIn.dll using Import-Module If the snap-in later needs to be registered in PowerShell, this can be manually done by running one of the following command in PowerShell. The path where the Citrix.PVS.SnapIn.dll is installed needs to be used. Import-Module path\citrix.pvs.snapin.dll Registration of Citrix.PVS.SnapIn.dll using Add-PSSnapin If the snap-in later needs to be registered in PowerShell, this can be manually done by running one of the following commands at the DOS command prompt. After the command is run and PowerShell is started, the snap-in needs to be added using the command Add-PSSnapin -Name Citrix.PVS.SnapIn. 64-bit Registration %systemroot%\microsoft.net\framework64\v \installutil.exe Citrix.PVS.SnapIn.dll 12 32-bit Registration %systemroot%\microsoft.net\framework\v \installutil.exe Citrix.PVS.SnapIn.dll Alternative Registration of Citrix.PVS.SnapIn.dll in PowerShell Another way to register is by running one of the following commands at the PowerShell command prompt: 64-bit Registration in PowerShell $installutil = $env:systemroot + '\Microsoft.NET\Framework64\v \installutil.exe' &$installutil Citrix.PVS.SnapIn.dll Add-PSSnapin -Name Citrix.PVS.SnapIn 32-bit Registration in PowerShell $installutil = $env:systemroot + '\Microsoft.NET\Framework32\v \installutil.exe' &$installutil Citrix.PVS.SnapIn.dll Add-PSSnapin -Name Citrix.PVS.SnapIn Uninstall of PowerShell Snap-In The PowerShell snap-in (Citrix.PVS.SnapIn.dll) can be uninstalled using the Provisioning Server Console install. Unregister of Citrix.PVS.SnapIn.dll The snap-in needs to be unregistered from PowerShell, this can be manually done by running one of the following commands at the DOS command prompt: 64-bit Unregister %systemroot%\microsoft.net\framework64\v \installutil.exe -u Citrix.PVS.SnapIn.dll 32-bit Unregister %systemroot%\microsoft.net\framework\v \installutil.exe -u Citrix.PVS.SnapIn.dll Alternative Unregister of Citrix.PVS.SnapIn.dll in PowerShell Another way to unregister is by running one of the following commands at the PowerShell command prompt: 13 64-bit Unregister in PowerShell $installutil = $env:systemroot + '\Microsoft.NET\Framework64\v \installutil.exe' &$installutil -u Citrix.PVS.SnapIn.dll 32-bit Unregister in PowerShell $installutil = $env:systemroot + '\Microsoft.NET\Framework32\v \installutil.exe' &$installutil -u Citrix.PVS.SnapIn.dll Setup of the SOAP Server Communication Unless the defaults are fine, use this command to set the values for the SOAP Server connection: Set-PvsConnection Set the SoapServer connection, and if -Persist is specified the connection settings are saved in the registry. A PvsConnection object can be used as the parameter. Required PvsConnection Connection: PvsConnection object with changed property value(s) to be set. The object can come from a pileline. These values are in the PvsConnection object, and only will be set if the value has changed. string Name or Server: Name or IP of the Server to connect to. Default=localhost string Port: The Port to use to connect. Default=54321 string User: User name to use for Authentication. If it has a value, it will be *****. Default= string Domain: Domain name to use for Authentication. If it has a value, it will be *****. Default= string Password: Password to use for Authentication. If it has a value, it will be *****. Default= string Persist: True when the connection settings should be, for Set, or have been, for Get, saved to the registry. PvsConnection can be created or modified using methods below: New-Object Citrix.PVS.SnapIn.PvsConnection: Creates default Server=localhost, Port=54321, and no authentication. New-Object Citrix.PVS.SnapIn.PvsConnection(Citrix.PVS.SnapIn copyfrom): Creates with settings of the copyfrom Citrix.PVS.SnapIn. SetServerToLocalHostDefaultSettings: Server=localhost, Port=54321, and no authentication. 14 Copy(Citrix.PVS.SnapIn copyfrom): Modifies the settings to match the copyfrom Citrix.PVS.SnapIn. Equals(Citrix.PVS.SnapIn compareto): Returns true when the settings match what is in the compareto. When Connection is not passed, the parameters below are used: Optional field values to set: string Name or Server: Name or IP of the Server to connect to. Default=localhost string Port: The Port to use to connect. Default=54321 string User: User name to use for Authentication. If it has a value, it will be *****. Default= string Domain: Domain name to use for Authentication. If it has a value, it will be *****. Default= string Password: Password to use for Authentication. If it has a value, it will be *****. Default= string Persist: True when the connection settings should be, for Set, or have been, for Get, saved to the registry. Optional SwitchParameter PassThru: If -PassThru is specified, the resulting PvsConnection object is returned. SwitchParameter Confirm: The impact of this operation is low . If - Confirm is specified, the operation will be confirmed. $ConfirmPreference can be set to low to have confirmation without the Confirm parameter. EXAMPLE 1: Set PvsConnection for Individual Fields Get the PvsConnection into a $o variable. Change the $o field values and then Set the PvsConnection with the result. $o = Get-PvsConnection -Fields Port $o.port = Set-PvsConnection $o The -Fields parameter with only the needed fields specified makes the EXAMPLE 2: Set PvsConnection for a Field Using Pipe Get the PvsConnection into a $o variable for the field that has the wrong value. Change the $o field to the correct value and then Set the PvsConnection with the result. 15 Get-PvsConnection -Fields Port Where-Object {$_.Port -ne 54322} foreach { $o = $_; $o.port = 54322; $o } Set- PvsConnection The -Fields parameter with only the needed fields specified makes the The foreach { $o = $_; $o.x = Y; $o } sets the field X to value Y and returns the object again so it can be piped to the Set command for update. EXAMPLE 3: Set PvsConnection Port with Parameter Set the PvsConnection Port using the Port parameter instead of a PvsConnection object. Set-PvsConnection -Port This is the only Set command that has field parameters. Command Specific Help All of the documentation for specific commands is included in the command-line help by calling Get-Help and the name of the command, for example Get-Help Get-PvsDevice. The documentation for the specific command includes information about the object that is may get or set. The documentation of all of the objects is included in the Objects, in the Citrix.PVS.SnapIn Namespace section. Error Handling For the Citrix.PVS.SnapIn, if an error occurs, a PvsException will be in the Exception member of the $error. The Error codes information is included in this document. The members of a PvsException are: InnerException: The exception that occured. This exception maybe an EAException or other standard Exception. ToString(): Has the formatted full Message of the InnerException. If the InnerException GetType().Name equals EAException , then The members of it are: returncode: The number, as shown below in the Error codes. The name of the error, for example NotImplemented , is not included in the EAException. Message: The message, as shown below in the Error codes. The [v1], [v2], [v3], [v4], and [v5] will be replaced with values as required. Details: Has the Details for the EAException if there are any. OtherException, ManagementInterfaceError and PvsStatusException will have Details. 16 ToString(): Has the Message as shown below in the Error codes. If there is Details, it will be returned or included, and if partialreturn, they will be included. partialreturn: Might have a list of EAException objects if any of the items processed during the command had any issues. Severity: Can have the values Critical, Error, Warning or Duplicate. Source: Has the value that is displayed in the Console as a Title or Type for the error. Short cmdlet list Add-PvsDeviceToDomain Add-PvsDeviceToView Add-PvsDiskLocatorToDevice Add-PvsDiskToUpdateTask Add-PvsDiskVersion Clear-PvsConnection Clear-PvsTask Copy-PvsDeviceProperties Copy-PvsDiskProperties Copy-PvsServerProperties Disable-PvsDeviceDiskLocator Dismount-PvsDisk Enable-PvsDeviceDiskLocator Export-PvsAuditTrail Export-PvsDisk Export-PvsOemLicenses Get-PvsADAccount Get-PvsAuditActionParameter Get-PvsAuditActionProperty Get-PvsAuditActionSibling Get-PvsAuditTrail Get-PvsAuthGroup Get-PvsAuthGroupUsage Get-PvsCollection Get-PvsConnection Get-PvsCreateDiskStatus 17 Get-PvsDevice Get-PvsDeviceBootstrap Get-PvsDeviceCount Get-PvsDeviceDiskLocatorEnabled Get-PvsDeviceInfo Get-PvsDevicePersonality Get-PvsDeviceStatus Get-PvsDirectory Get-PvsDisk Get-PvsDiskInfo Get-PvsDiskInventory Get-PvsDiskLocator Get-PvsDiskLocatorCount Get-PvsDiskLocatorLock Get-PvsDiskUpdateDevice Get-PvsDiskUpdateStatus Get-PvsDiskVersion Get-PvsExists Get-PvsFarm Get-PvsFarmView Get-PvsGroup Get-PvsLocalServer Get-PvsMaintenanceVersionExists Get-PvsMinimumLastAutoAddDeviceNumber Get-PvsMountedDisk Get-PvsMountedDriveLetter Get-PvsNewDiskVersion Get-PvsServer Get-PvsServerBiosBootstrap Get-PvsServerBootstrap Get-PvsServerBootstrapName Get-PvsServerCount Get-PvsServerInfo Get-PvsServerName Get-PvsServerStatus Get-PvsServerStore 18 Get-PvsServerStoreActiveDeviceCount Get-PvsSite Get-PvsSiteView Get-PvsStore Get-PvsStoreFreeSpace Get-PvsStoreSharedOrServerPath Get-PvsTask Get-PvsTaskStatus Get-PvsUndefinedDisk Get-PvsUpdateTask Get-PvsVersion Get-PvsVirtualHostingPool Get-PvsXDSite Grant-PvsAuthGroup Import-PvsDevices Import-PvsDisk Import-PvsOemLicenses Invoke-PvsActivateDeviceMAK Invoke-PvsMarkDown Invoke-PvsPromoteDiskVersion Invoke-PvsRebalanceDevices Invoke-PvsRevertDiskVersion Merge-PvsDisk Mount-PvsDisk Move-PvsDeviceToCollection Move-PvsServerToSite New-PvsAuthGroup New-PvsCollection New-PvsDevice New-PvsDeviceWithPersonalvDisk New-PvsDirectory New-PvsDiskLocator New-PvsDiskMaintenanceVersion New-PvsDiskUpdateDevice New-PvsFarmView New-PvsServer 19 New-PvsSite New-PvsSiteView New-PvsStore New-PvsUpdateTask New-PvsVirtualHostingPool Remove-PvsAuthGroup Remove-PvsCollection Remove-PvsDevice Remove-PvsDeviceDiskCacheFile Remove-PvsDeviceFromDomain Remove-PvsDeviceFromView Remove-PvsDirectory Remove-PvsDiskFromUpdateTask Remove-PvsDiskLocator Remove-PvsDiskLocatorFromDevice Remove-PvsDiskUpdateDevice Remove-PvsDiskVersion Remove-PvsFarmView Remove-PvsServer Remove-PvsServerStore Remove-PvsSite Remove-PvsSiteView Remove-PvsStore Remove-PvsUpdateTask Remove-PvsVirtualHostingPool Reset-PvsDatabase Reset-PvsDeviceForDomain Restart-PvsStreamService Revoke-PvsAuthGroup Set-PvsAuthGroup Set-PvsCollection Set-PvsConnection Set-PvsDevice Set-PvsDeviceBootstrap Set-PvsDevicePersonality Set-PvsDisk 20 Set-PvsDiskLocator Set-PvsDiskUpdateDevice Set-PvsDiskVersion Set-PvsFarm Set-PvsFarmView Set-PvsOverrideVersion Set-PvsServer Set-PvsServerBiosBootstrap Set-PvsServerBootstrap Set-PvsServerStore Set-PvsSite Set-PvsSiteView Set-PvsStore Set-PvsUpdateTask Set-PvsVirtualHostingPool Set-PvsXDSite Start-PvsAutoUpdate Start-PvsCreateDisk Start-PvsDeviceBoot Start-PvsDeviceReboot Start-PvsDeviceShutdown Start-PvsDisplayMessage Start-PvsStreamService Start-PvsUpdateTask Stop-PvsCreateDisk Stop-PvsStreamService Stop-PvsTask Stop-PvsUpdateTask Test-PvsDirectory Unlock-PvsAllDisk Unlock-PvsDisk Update-PvsBootPartitionBDM Update-PvsInventory 21 Cmdlet by Object Type Many Clear-PvsConnection Get-PvsAuditActionParameter Get-PvsAuditActionProperty Get-PvsAuditActionSibling Get-PvsAuditTrail Get-PvsConnection Get-PvsExists Reset-PvsDatabase Set-PvsConnection AuthGroup Get-PvsAuthGroup Get-PvsAuthGroupUsage Grant-PvsAuthGroup New-PvsAuthGroup Remove-PvsAuthGroup Revoke-PvsAuthGroup Set-PvsAuthGroup Collection Get-PvsCollection Get-PvsMinimumLastAutoAddDeviceNumber New-PvsCollection Remove-PvsCollection Set-PvsCollection Device Add-PvsDeviceToDomain Add-PvsDeviceToView Copy-PvsDeviceProperties Disable-PvsDeviceDiskLocator Enable-PvsDeviceDiskLocator Export-PvsOemLicenses Get-PvsDevice 22 Get-PvsDeviceBootstrap Get-PvsDeviceCount Get-PvsDeviceDiskLocatorEnabled Get-PvsDeviceInfo Get-PvsDevicePersonality Get-PvsDeviceStatus Import-PvsDevices Import-PvsOemLicenses Invoke-PvsActivateDeviceMAK Invoke-PvsMarkDown Move-PvsDeviceToCollection New-PvsDevice New-PvsDeviceWithPersonalvDisk Remove-PvsDevice Remove-PvsDeviceDiskCacheFile Remove-PvsDeviceFromDomain Remove-PvsDeviceFromView Reset-PvsDeviceForDomain Set-PvsDevice Set-PvsDeviceBootstrap Set-PvsDevicePersonality Start-PvsDeviceBoot Start-PvsDeviceReboot Start-PvsDeviceShutdown Start-PvsDisplayMessage Update-PvsBootPartitionBDM Disk Add-PvsDiskToUp
Recommended
View more...
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks