Citrix Provisioning Services 7.1 Powershell Programmer s Guide. Revison 1 October PDF

Please download to get full document.

View again

of 33
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:

Government & Nonprofit

Published:

Views: 2 | Pages: 33

Extension: PDF | Download: 0

Share
Related documents
Description
Citrix Provisioning Services 7.1 Powershell Programmer s Guide Revison 1 October 2013 Copyright and Trademark Notice Information in this document is subject to change without notice. Companies, names,
Transcript
Citrix Provisioning Services 7.1 Powershell Programmer s Guide Revison 1 October 2013 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... 7 Using the PowerShell Programmer Interface... 7 Installation of PowerShell... 7 Installation of PowerShell Snap-In... 7 Uninstall of PowerShell Snap-In... 8 Setup of the SOAP Server Communication... 9 PowerShell Snap-In Command Types... 9 Mcli-Add... 9 Short Description... 9 Detailed Description... 9 Input Type... 9 Input Type Description Return Type Return Type Description Parameters Help Example Device Example Mcli-Delete Short Description Syntax Detailed Description Input Type Input Type Description Return Type Return Type Description Parameters Help Example Device Example Mcli-Get Short Description Syntax Detailed Description Input Type Description Return Type Return Type Description Parameters Help Example Device All Example Device Example Mcli-Help Short Description Detailed Description Input Type Input Type Description Return Type Return Type Description Parameters Help Example Mcli-Info Short Description Detailed Description Input Type Input Type Description Return Type Return Type Description Parameters Help Example Version Example Mcli-Run Short Description Detailed Description Input Type Input Type Description Return Type Return Type Description Parameters Help Example Mcli-RunWithReturn Short Description Detailed Description Input Type Input Type Description Return Type Return Type Description Parameters Help Example DeviceCount Example Mcli-Set Short Description Detailed Description Input Type Input Type Description Return Type Return Type Description Parameters Help Example Device Example Mcli-SetList Short Description Detailed Description Input Type Input Type Description Return Type Return Type Description Parameters Help Example ServerCustomProperty Example Short command list Mcli-Add Mcli-Delete Mcli-Get Mcli-Info Mcli-Run Mcli-RunWithReturn Mcli-Set Mcli-SetList Commands by Object Type: Many AuthGroup Collection Device Disk DiskLocator Farm FarmView Server Site SiteView Store System Task UpdateTask Error codes Command list Mcli-Add Mcli-Delete Mcli-Get Mcli-Info Mcli-Run Mcli-RunWithReturn Mcli-Set Mcli-SetList 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. Three different programming interfaces exist: Management Command Line Interface (MCLI) Simple Object Access Protocol (SOAP) Server Programmer Interface PowerShell Programmer Interface This document provides the information needed to use this interface. Using the PowerShell Programmer Interface Use the information that follows to manage a Provisioning Service s implementation from the PowerShell interface. Installation of PowerShell PowerShell can be downloaded from: wnload.mspx After you have downloaded and installed PowerShell, start a PowerShell command prompt (you can use either the start menu item or the shortcut on your desktop). By default, PowerShell will not run scripts. You need to do a one-time configuration fix to enable scripting. Type the command: set-executionpolicy remotesigned Installation of PowerShell Snap-In The PowerShell snap-in (McliPSSnapIn.dll) can be installed using the Provisioning Server Console install. If it later needs to be registered in PowerShell, this can be manually done by running one of the following commands at the DOS command prompt: For 32-bit %systemroot%\microsoft.net\framework\v \installutil.exe McliPSSnapIn.dll For 64-bit %systemroot%\microsoft.net\framework64\v \installutil.exe McliPSSnapIn.dll 7 Another way to register is by running one of the following commands at the PowerShell command prompt: For 32-bit $installutil = $env:systemroot + '\Microsoft.NET\Framework\v \installutil.exe' &$installutil McliPSSnapIn.dll For 64-bit $installutil = $env:systemroot + '\Microsoft.NET\Framework64\v \installutil.exe' &$installutil McliPSSnapIn.dll To install the Snap-In to a running PowerShell command prompt, run this command: Add-PSSnapin -Name McliPSSnapIn Uninstall of PowerShell Snap-In The PowerShell snap-in (McliPSSnapIn.dll) can be uninstalled using the Provisioning Server Console install. It can be manually unregistered from PowerShell, by running one of the following commands at a DOS command prompt: For 32-bit %systemroot%\microsoft.net\framework\v \installutil.exe -u McliPSSnapIn.dll For 64-bit %systemroot%\microsoft.net\framework64\v \installutil.exe -u McliPSSnapIn.dll Another way to unregister is by running the following at the at a PowerShell command prompt: For 32-bit $installutil = $env:systemroot + '\Microsoft.NET\Framework\v \installutil.exe' &$installutil -u McliPSSnapIn.dll For 64-bit $installutil = $env:systemroot + '\Microsoft.NET\Framework64\v \installutil.exe' &$installutil -u McliPSSnapIn.dll 8 Setup of the SOAP Server Communication Unless the defaults are fine, use this command to set the values for the SOAP Server connection: Mcli-Run SetupConnection name=value[, name2=value2] Setup the SOAP server connection that will be used for the MCLI and PowerShell command line interfaces. Parameters needed for this Run. Optional server Server used for the connection. Default=localhost port Port used for the connection. Default=8000 user User used for the connection. Default=Current user domain User domain used for the connection. Default=Current user password User password used for the connection. Default=Current user PowerShell Snap-In Command Types There are 9 types of commands that used to run the PowerShell snap-in (McliPSSnapIn.dll). Mcli-Add Short Description Add an AuthGroup, Collection, Device, DiskLocator, FarmView, Server, Site, SiteView, Store or UserGroup. Detailed Description Add an object. The format is: Mcli-Add type [ name=value[, name2=value2]] -r name=value, name2=value2 type specifies the type of object being added. To get help on what parameters are needed for a specific type, enter Mcli-Help Add type , for example: Mcli-Help Add Device has a list of name=value pair parameters as needed to add the object. -r has the definition of the record name=value pairs needed to define the object. If successful, a string GUID unique ID of the object is returned. Input Type Mcli-Add type [ name=value[, name2=value2]] -r name=value[, name2=value2] 9 Input Type Description type can be any of these: AuthGroup: Add an Active Directory or Windows Group for authorization. Collection: Add a Collection to a Site. Device: Add a Device to a Collection. DiskLocator: Add a Disk Locator to a Site. The Disk file must already exist. FarmView: Add a View to a Farm. Server: Add a Server to a Site. Site: Add a Site to the system. SiteView: Add a View to a Site. Store: Add a Store to the system. UserGroup: Add an Active Directory or Windows Group for users. To get help on the [ name=value[, name2=value2]] -r name=value[, name2=value2] , specify Add type . For example: Mcli-Help Add AuthGroup Return Type Returns a string GUID that is the unique ID of the object added. Return Type Description Before executing a command, $error.clear() should be called. After executing a command, it was successful if $error.count equals 0. If $error.count 0 then $error[0].fullyqualifiederrorid.split(',')[0].trim() will be equal to one of the return codes. To get help on return codes, specify only Codes. For example: Mcli-Help Codes Return Type Returns a string GUID that is the unique ID of the object added. Return Type Description Before executing a command, $error.clear() should be called. After executing a command, it was successful if $error.count equals 0. If $error.count 0 then $error[0].fullyqualifiederrorid.split(',')[0].trim() will be equal to one of the return codes. To get help on return codes, specify only Codes. For example: Mcli-Help Codes Parameters Type Type of object to add. Valid values are AuthGroup, Collection, Device, DiskLocator, FarmView, Server, Site, SiteView, Store or UserGroup. r List of name=value pairs needed to define the object. They are comma delimited. 10 Help Example Example Command Mcli-Help Add Device Example Description Displays help on the parameters needed for the Type of add. The Device above can be any of these values: AuthGroup, Collection, Device, DiskLocator, FarmView, Server, Site, SiteView, Store or UserGroup. Example Output Add a new Device to a collection. Mcli-Add Device -r name=value, name2=value2 -r = record values to be set. devicename Computer name with no spaces. ASCII Max Length=15 collectionid GUID of the Collection this Device is to be a member of. It is not used with collectionname. Length=36 collectionname Name of the Collection this Device is to be a member of. or must also be used. GUID of the Site the collectionname is to be a member of. This or is used with collectionname. Name of the Site the collectionname is to be a member of. This or is used with collectionname. description User description. Default= Max Length=250 devicemac Ethernet address as a string in the form XX- XX-XX-XX-XX-XX. Uniquely identifies the Device. Length=17 bootfrom Device to boot from. Choices are 1 for Vdisk, 2 for Hard Disk, and 3 for Floppy. Min=1, Max=3, Default=1 classname Used by Automatic Update feature to match new versions of Disks to a Device. Default= Max Length=41 port UDP port to use with Stream Service. Min=1025, Max=65536, Default=6901 enabled 1 when it can be booted, 0 otherwise. Default=1 localdiskenabled If there is a local disk menu choice for the Device, this is 1. Default=0 authentication Device log in authentication. Choices are 0 for none, 1 for User Name/Password, and 2 for Extern. Min=0, Max=2, Default=0 user Name of user to authenticate before the boot process continues. Default= ASCII Max Length=20 11 password copytemplate adtimestamp adsignature resultid Password of user to authenticate before the boot process continues. Default= ASCII Max Length=100 1 if the Template Device for the collection, if it exists, should be used for the property settings of the added Device. The time the Active Directory machine account password as generated. Default=0 The signature of the Active Directory machine account password. Default=0 If successful, the GUID of the record added. Device Example Example Command mcli-add Device -r devicename=device1, devicemac=1a-2b-3c-4d-5e-6f, description= a description Example Description Adds a Device. The devicename and devicemac are required and must not already exist. The description is optional. Example Output Executing: Add Device Add succeeded. resultid = e7cc9adb a-89bb-1988de82d793 Mcli-Delete Short Description Delete an AuthGroup, Collection, Device, DeviceDiskCacheFile, DiskLocator, DiskUpdateDevice, DiskVersion, FarmView, Server, ServerStore, Site, SiteView, Store, UpdateTask or VirtualHostingPool. Syntax Mcli-Delete [-Type] String String[] Detailed Description Delete an object. The format is: Mcli-Delete type [ name=value[, name2=value2]] type specifies the type of object being deleted. To get help on what parameters are needed for a specific type, enter Mcli-Help Delete type , for example: Mcli-Help Delete Device has a list of name=value pair parameters as needed to delete the object. 12 Input Type Mcli-Delete type [ name=value[, name2=value2]] Input Type Description type can be any of these: AuthGroup: Deletes an AuthGroup Active Directory or Windows Group name. Collection: Deletes a Collection. Device: Deletes one or more Devices. DeviceDiskCacheFile: Deletes the Disk cache files for a Device. DiskLocator: Deletes one or more Disk Locators. DiskUpdateDevice: Deletes a Disk Update Device. DiskVersion: Removes the latest Disk version or no longer needed version if no Devices are currently booted from that version. FarmView: Deletes a View from the Farm. Server: Deletes a Server. ServerStore: Delete the connection from a Server to a Store. Site: Deletes a Site. SiteView: Deletes a View from a Site. Store: Deletes a Store. UpdateTask: Deletes an Update Task from a Site. VirtualHostingPool: Deletes a Virtual Hosting Pool from a Site. To get help on the [ name=value[, name2=value2]], specify Delete type . For example: Mcli-Help Delete AuthGroup Return Type None Return Type Description Before executing a command, $error.clear() should be called. After executing a command, it was successful if $error.count equals 0. If $error.count 0 then $error[0].fullyqualifiederrorid.split(',')[0].trim() will be equal to one of the return codes. To get help on return codes, specify only Codes. For example: Mcli-Help Codes Parameters Type Type of object to delete. Valid values are AuthGroup, Collection, Device, DeviceDiskCacheFile, DiskLocator, DiskUpdateDevice, DiskVersion, FarmView, Server, ServerStore, Site, SiteView, Store, UpdateTask or VirtualHostingPool. Required? true Position? 1 Default value 13 Accept pipeline input? false Accept wildcard characters? false p List of name=value pairs needed to define what to process. They are comma delimited. Required? true Position? named Default value Accept pipeline input? false Accept wildcard characters? False Help Example Example Command C:\PS Mcli-Help Delete Device Example Description Displays help on the parameters needed for the Type of delete. The Device above can be any of these values: AuthGroup, Collection, Device, DeviceDiskCacheFile, DiskLocator, DiskUpdateDevice, DiskVersion, FarmView, Server, ServerStore, Site, SiteView, Store, UpdateTask or VirtualHostingPool. Example Output Deletes one or more Devices. Mcli-Delete Device[ name=value[, name2=value2]] = parameters to specify the criteria are listed below: deviceid GUID of the Device to Delete. devicename Name of the Device to Delete. devicemac MAC of the Device to Delete. collectionid GUID of the Collection to delete all Devices. or this required & resolution collectionname Name of the Collection to delete all Devices. One of these resolution when needed GUID of the Site. Name of the Site. Device Example Example Command C:\PS mcli-Delete Device devicename=device1 14 Example Description Deletes a Device. Example Output Executing: Delete Device Delete succeeded. Mcli-Get Short Description Get AdDomains, AuditActionParameters, AuditActionProperties, AuditActionSibling, AuditTrail, AuthGroup, AuthGroupUsage, Collection, CommandDescription, CommandFields, CommandParameters, CommandSortFields, CommandStandardParameters, Device, DeviceBootstraps, DeviceCustomProperty, DeviceDiskPrinters, DeviceInfo, DevicePersonality, DeviceStatus, Disk, DiskInfo, DiskInventory, DiskLocator, DiskLocatorCustomProperty, DiskLocatorLock, DiskPrinters, DiskUpdateDevice, DiskUpdateStatus, DiskVersion, ExceptionDescriptions, Farm, FarmView, Groups, NewVersionDisks, Server, ServerBiosBootstrap, ServerBootstrap, ServerBootstrapNames, ServerCustomProperty, ServerInfo, ServerStatus, ServerStore, Site, SiteView, Store, StoreSharedOrServerPath, Task, UndefinedDisks, UpdateTask, VirtualHostingPool or XDSite. Syntax Mcli-Get [-Type] String [ String[] ] [-f String[] ] [-s String ] Detailed Description Get one or more objects. The format is: Mcli-Get type [ name=value[, name2=value2]][ -f field1[, field2]][ -s sortfield-] type specifies the type of object being get. To get help on what parameters are needed for a specific type, enter Mcli-Help Get type , for example: Mcli-Help Get Device has a list of name=value pair parameters as needed to get the objects. -f is a list of fields to be returned, if none are specified then all are returned. -s is the field to sort on, if not specified the output is sorted by any included *Name field. Append a - to the field name to get descending order. If successful, the records found are listed. Input Type Description type can be any of these: AdDomains: Gets all of the available Active Directory domains. AuditActionParameters: Get the Parameters of an Audit Action. AuditActionProperties: Get the Properties of an Audit Action. AuditActionSibling: Get the Sibling of an Audit Action. It is the 2nd object involved with the action. AuditTrail: Gets the Audit Trail actions for a Farm, Site, Server, DiskLocator, Collection, Device, User Group, Site View, Farm View or Store. The result can be filtered by parent, user\domain and date range. 15 AuthGroup: Gets the fields for an AuthGroup, all AuthGroups in the system, AuthGroups with Farm, Site or Collection Authorization. All AuthGroups in the system are returned if no parameters are passed. AuthGroupUsage: Gets the items that are authorized for an AuthGroup. Collection: Gets the fields for a Collection or all Collections in a Site or Farm. CommandDescription: Returns one or more commands with description. CommandFields: Returns one record with fields and descriptions. CommandParameters: Returns records with parameter type, parameters and descriptions. Parameter types that maybe returned include: Optional, RequiredSingle, OptionalSingle, RequiredSingleAmbiguous, OptionalSingleAmbiguous, and Resolution. CommandSortFields: Returns one record with sort fields and descriptions. CommandStandardParameters: Returns one record with standard parameter types and descriptions. Parameter types that maybe returned include: parameters, fields, record, records, sortfield, resultid, rv, startposition, maxrecords, totalcount, datain, dataout, and commands. Device: Gets the fields for a Device, all Devices in a Collection, Site, Farm View, or Farm. DeviceBootstraps: Get all Bootstrap files for a Device, and the menutext for each. DeviceCustomProperty: Get the Device Custom Property names and values. DeviceDiskPrinters: Get all non-disabled Printers for a Device/Disk, and the setting for each. DeviceInfo: Gets the fields and status for a Device, all Devices in a Collection, Site, Farm View, or Farm. DevicePersonality: Get the Device Personality names and values. DeviceStatus: Gets the Device Status fields for a Device or all Devices for a Server, Disk Locator, or Farm. Disk: Get the fields for a single disk. DiskInfo: Gets the fields for a Disk and Disk Locator or all Disks and Disk Locators for a Device, Server, Store, Site, or Farm. DiskInventory: Gets the fields for Inventory Status of a Disk Version or all Disk Versions for a Disk Locator. DiskLocator: Gets the fields for a Disk Locator or all Disk Locators for a Device, Server, Store, Site, or Farm. DiskLocatorCustomProperty: Get the DiskLocator Custom Property names and values. DiskLocatorLock: Gets the fields for all the locks of a Disk Locator. DiskPrinters: Get all available Printers for a Disk. DiskUpdateDevice: Gets the fields and status for a Disk Up
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