Download VMware VCM 5.3 - TRANSPORT LAYER SECURITY IMPLEMENTATION User`s guide
Transcript
vCenter Configuration Manager Installation and Getting Started Guide n The default WCI filter returns PowerShell version information from VCM-managed machines. n Do not include any formatting white space. For example, do not use CR LF at the end of elements, nodes, or attributes. See also the example below of developing a custom PowerShell script for use with the WCI data type. Example of Developing a Custom PowerShell Script for Use with the WCI Data Type In this example, the objective is to collect scheduled tasks information from Windows clients. On newer systems, Windows conveniently provides the schtasks.exe utility to report on scheduled tasks created either through the Task Scheduler user interface or through use of the AT command. n Running schtasks by itself returns only basic data about tasks. n Adding the /query /v switches provides additional information, but the formatting is difficult for automated processing. n The schtasks /query /? command provides additional possibilities. n The option set of schtasks /query /v /fo:csv is selected as the source for the data for the collection script. These options give full details for all tasks in a comma-separated value result set. PowerShell makes working with tabular result sets from commands easy. A first step for this script is to run a command similar to: $schtasks = schtasks /query /v /fo:csv Since the data returned from schtasks includes multiple rows, PowerShell makes the $schtasks variable into an array. As such, $schtasks[0] represents the first row returned from the command. Viewing the result set by looking at $schtasks[n] shows that that the first line, $schtasks[0], is blank; $schtasks[1] contains column names, and $schtasks[2] is the first row of task data. The goal, then, is to parse this data into a structure compatible with VCM’s XML format for return to the Collector. The Scheduled Tasks script uses the split method of PowerShell strings to separate the columns of the $schtasks rows into separate values in arrays. The column names row provides the names to use for attributes, and the corresponding data from the scheduled task rows provide the values to use for these attributes. Once parsed, the XML returned by the script should look something like: <schtasks> <taskname1> <attribute1>Value1</attribute1> <attribute2>Value2</attribute2> … </taskname1> <taskname2> <attribute1>Value1</attribute1> <attribute2>Value2</attribute2> … </taskname2> … </schtasks> 94 VMware, Inc.