
{"id":1205,"date":"2014-03-22T01:48:05","date_gmt":"2014-03-22T01:48:05","guid":{"rendered":"http:\/\/tech-no.104.210.61.21.xip.io\/?p=1205"},"modified":"2014-03-22T01:48:05","modified_gmt":"2014-03-22T01:48:05","slug":"creating-xenapp-6-5-farm-documentation","status":"publish","type":"post","link":"https:\/\/tech-no.org\/?p=1205","title":{"rendered":"Creating XenApp 6.5 farm Documentation"},"content":{"rendered":"<p>I get this request from time to time, and usually start with this when taking on a new client with Citrix XenApp 6.5. Documenting the current state. This helps me understand what I am going to be taking on, and compare and contrast the configuration over time.<\/p>\n<p><span style=\"line-height: 1.5;\">In the old days different scripts using mfcom were used, now we use powershell with the Citrix xenapp powershell sdk. For example you used to use vbscript like this:\u00a0<\/span><a style=\"line-height: 1.5;\" title=\"http:\/\/www.czerno.com\/default.asp?inc=\/html\/citrix\/scripts\/PubAppReportexcel.asp\" href=\"http:\/\/www.czerno.com\/default.asp?inc=\/html\/citrix\/scripts\/PubAppReportexcel.asp\" target=\"_blank\">http:\/\/www.czerno.com\/default.asp?inc=\/html\/citrix\/scripts\/PubAppReportexcel.asp<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>You will need the SDK from Citrix to run these powershell scripts:\u00a0<a title=\"https:\/\/www.citrix.com\/English\/ss\/downloads\/details.asp?downloadId=1687620&amp;productId=186#top\" href=\"https:\/\/www.citrix.com\/English\/ss\/downloads\/details.asp?downloadId=1687620&amp;productId=186#top\">https:\/\/www.citrix.com\/English\/ss\/downloads\/details.asp?downloadId=1687620&amp;productId=186#top<\/a><\/p>\n<p>I want to give credit to this script to Carl Webster (he did a great job with these and I have used them often: (<a title=\"http:\/\/carlwebster.com\/documenting-a-citrix-xenapp-6-5-farm-with-microsoft-powershell\/\" href=\"http:\/\/carlwebster.com\/documenting-a-citrix-xenapp-6-5-farm-with-microsoft-powershell\/\" target=\"_blank\">http:\/\/carlwebster.com\/documenting-a-citrix-xenapp-6-5-farm-with-microsoft-powershell\/<\/a>)<\/p>\n<p>Here is a link to the list of various scripts for documenting Citrix with powershell.<\/p>\n<p><a title=\"http:\/\/carlwebster.com\/where-to-get-copies-of-the-documentation-scripts\/\" href=\"http:\/\/carlwebster.com\/where-to-get-copies-of-the-documentation-scripts\/\" target=\"_blank\">http:\/\/carlwebster.com\/where-to-get-copies-of-the-documentation-scripts\/\u00a0<\/a><\/p>\n<p>I am quite fond of this script:<\/p>\n<p><a title=\"https:\/\/dl.dropboxusercontent.com\/u\/43555945\/XA65_Inventory_V41.ps1\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/43555945\/XA65_Inventory_V41.ps1\" target=\"_blank\">https:\/\/dl.dropboxusercontent.com\/u\/43555945\/XA65_Inventory_V41.ps1<\/a><\/p>\n<p>i have pasted the current version here in case the site goes down: (save as a .PS1 file)<\/p>\n<pre>#This File is in Unicode format.  Do not edit in an ASCII editor.\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n\tCreates a complete inventory of a Citrix XenApp 6.5 farm using Microsoft Word.\r\n.DESCRIPTION\r\n\tCreates a complete inventory of a Citrix XenApp 6.5 farm using Microsoft Word and PowerShell.\r\n\tCreates either a Word document or PDF named after the XenApp 6.5 farm.\r\n\tDocument includes a Cover Page, Table of Contents and Footer.\r\n\tVersion 4.xx includes support for the following language versions of Microsoft Word:\r\n\t\tCatalan\r\n\t\tDanish\r\n\t\tDutch\r\n\t\tEnglish\r\n\t\tFinnish\r\n\t\tFrench\r\n\t\tGerman\r\n\t\tNorwegian\r\n\t\tPortuguese\r\n\t\tSpanish\r\n\t\tSwedish\r\n.PARAMETER CompanyName\r\n\tCompany Name to use for the Cover Page.  \r\n\tDefault value is contained in HKCU:\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName or\r\n\tHKCU:\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company, whichever is populated on the \r\n\tcomputer running the script.\r\n\tThis parameter has an alias of CN.\r\n.PARAMETER CoverPage\r\n\tWhat Microsoft Word Cover Page to use.\r\n\t(Default cover pages in Word en-US)\r\n\tValid input is:\r\n\t\tAlphabet (Word 2007\/2010. Works)\r\n\t\tAnnual (Word 2007\/2010. Doesn't really work well for this report)\r\n\t\tAustere (Word 2007\/2010. Works)\r\n\t\tAustin (Word 2010\/2013. Doesn't work in 2013, mostly works in 2007\/2010 but Subtitle\/Subject &amp; Author fields need to me moved after title box is moved up)\r\n\t\tBanded (Word 2013. Works)\r\n\t\tConservative (Word 2007\/2010. Works)\r\n\t\tContrast (Word 2007\/2010. Works)\r\n\t\tCubicles (Word 2007\/2010. Works)\r\n\t\tExposure (Word 2007\/2010. Works if you like looking sideways)\r\n\t\tFacet (Word 2013. Works)\r\n\t\tFiligree (Word 2013. Works)\r\n\t\tGrid (Word 2010\/2013.Works in 2010)\r\n\t\tIntegral (Word 2013. Works)\r\n\t\tIon (Dark) (Word 2013. Top date doesn't fit, box needs to be manually resized or font changed to 8 point)\r\n\t\tIon (Light) (Word 2013. Top date doesn't fit, box needs to be manually resized or font changed to 8 point)\r\n\t\tMod (Word 2007\/2010. Works)\r\n\t\tMotion (Word 2007\/2010\/2013. Works if top date is manually changed to 36 point)\r\n\t\tNewsprint (Word 2010. Works but date is not populated)\r\n\t\tPerspective (Word 2010. Works)\r\n\t\tPinstripes (Word 2007\/2010. Works)\r\n\t\tPuzzle (Word 2007\/2010. Top date doesn't fit, box needs to be manually resized or font changed to 14 point)\r\n\t\tRetrospect (Word 2013. Works)\r\n\t\tSemaphore (Word 2013. Works)\r\n\t\tSideline (Word 2007\/2010\/2013. Doesn't work in 2013, works in 2007\/2010)\r\n\t\tSlice (Dark) (Word 2013. Doesn't work)\r\n\t\tSlice (Light) (Word 2013. Doesn't work)\r\n\t\tStacks (Word 2007\/2010. Works)\r\n\t\tTiles (Word 2007\/2010. Date doesn't fit unless changed to 26 point)\r\n\t\tTranscend (Word 2007\/2010. Works)\r\n\t\tViewMaster (Word 2013. Works)\r\n\t\tWhisp (Word 2013. Works)\r\n\tDefault value is Sideline.\r\n\tThis parameter has an alias of CP.\r\n.PARAMETER UserName\r\n\tUser name to use for the Cover Page and Footer.\r\n\tDefault value is contained in $env:username\r\n\tThis parameter has an alias of UN.\r\n.PARAMETER PDF\r\n\tSaveAs PDF file instead of DOCX file.\r\n\tThis parameter is disabled by default.\r\n\tFor Word 2007, the Microsoft add-in for saving as a PDF muct be installed.\r\n\tFor Word 2007, please see http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=9943\r\n\tThe PDF file is roughly 5X to 10X larger than the DOCX file.\r\n.PARAMETER Hardware\r\n\tUse WMI to gather hardware information on: Computer System, Disks, Processor and Network Interface Cards\r\n\tThis parameter is disabled by default.\r\n.PARAMETER Software\r\n\tGather software installed by querying the registry.  \r\n\tUse SoftwareExclusions.txt to exclude software from the report.\r\n\tSoftwareExclusions.txt must exist, and be readable, in the same folder as this script.\r\n\tSoftwareExclusions.txt can be an empty file to have no installed applications excluded.\r\n\tSee Get-Help About-Wildcards for help on formatting the lines to exclude applications.\r\n\tThis parameter is disabled by default.\r\n.PARAMETER StartDate\r\n\tStart date, in MM\/DD\/YYYY HH:MM format, for the Configuration Logging report.\r\n\tDefault is today's date minus seven days.\r\n\tIf the StartDate is entered as 01\/01\/2014, the date becomes 01\/01\/2014 00:00:00.\r\n.PARAMETER EndDate\r\n\tEnd date, in MM\/DD\/YYYY HH:MM format, for the Configuration Logging report.\r\n\tDefault is today's date.\r\n\tIf the EndDate is entered as 01\/01\/2014, the date becomes 01\/01\/2014 00:00:00.\r\n.PARAMETER Summary\r\n\tOnly give summary information, no details.\r\n\tThis parameter is disabled by default.\r\n\tThis parameter cannot be used with either the Hardware, Software, StartDate or EndDate parameters.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1\r\n\r\n\tWill use all Default values.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -PDF -verbose\r\n\r\n\tWill use all Default values and save the document as a PDF file.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n\tWill display verbose messages as the script is running.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -Summary\r\n\r\n\tCreates a Summary report with no detail.\r\n\tWill use all Default values.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -PDF -Summary -verbose\r\n\r\n\tCreates a Summary report with no detail.\r\n\tWill use all Default values and save the document as a PDF file.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n\tWill display verbose messages as the script is running.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -Hardware -verbose\r\n\r\n\tWill use all Default values and add additional information for each server about its hardware.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n\tWill display verbose messages as the script is running.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -Software -verbose\r\n\r\n\tWill use all Default values and add additional information for each server about its installed applications.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n\tWill display verbose messages as the script is running.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -StartDate \"01\/01\/2014\" -EndDate \"01\/02\/2014\" -verbose\r\n\r\n\tWill use all Default values and add additional information for each server about its installed applications.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n\tWill display verbose messages as the script is running.\r\n\tWill return all Configuration Logging entries from \"01\/01\/2014 00:00:00\" through \"01\/02\/2014 \"00:00:00\".\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -StartDate \"01\/01\/2014\" -EndDate \"01\/01\/2014\" -verbose\r\n\r\n\tWill use all Default values and add additional information for each server about its installed applications.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n\tWill display verbose messages as the script is running.\r\n\tWill return all Configuration Logging entries from \"01\/01\/2014 00:00:00\" through \"01\/01\/2014 \"00:00:00\".  In other words, nothing is returned.\r\n.EXAMPLE\r\n\tPS C:\\PSScript &gt; .\\XA65_Inventory_V41.ps1 -StartDate \"01\/01\/2014 21:00:00\" -EndDate \"01\/01\/2014 22:00:00\" -verbose\r\n\r\n\tWill use all Default values and add additional information for each server about its installed applications.\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\CompanyName=\"Carl Webster\" or\r\n\tHKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Common\\UserInfo\\Company=\"Carl Webster\"\r\n\t$env:username = Administrator\r\n\r\n\tCarl Webster for the Company Name.\r\n\tSideline for the Cover Page format.\r\n\tAdministrator for the User Name.\r\n\tWill display verbose messages as the script is running.\r\n\tWill return all Configuration Logging entries from 9PM to 10PM on 01\/01\/2014.\r\n.EXAMPLE\r\n\tPS C:\\PSScript .\\XA65_Inventory_V41.ps1 -CompanyName \"Carl Webster Consulting\" -CoverPage \"Mod\" -UserName \"Carl Webster\"\r\n\r\n\tWill use:\r\n\t\tCarl Webster Consulting for the Company Name.\r\n\t\tMod for the Cover Page format.\r\n\t\tCarl Webster for the User Name.\r\n.EXAMPLE\r\n\tPS C:\\PSScript .\\XA65_Inventory_V41.ps1 -CN \"Carl Webster Consulting\" -CP \"Mod\" -UN \"Carl Webster\"\r\n\r\n\tWill use:\r\n\t\tCarl Webster Consulting for the Company Name (alias CN).\r\n\t\tMod for the Cover Page format (alias CP).\r\n\t\tCarl Webster for the User Name (alias UN).\r\n.INPUTS\r\n\tNone.  You cannot pipe objects to this script.\r\n.OUTPUTS\r\n\tNo objects are output from this script.  This script creates a Word or PDF document.\r\n.NOTES\r\n\tNAME: XA65_Inventory_V41.ps1\r\n\tVERSION: 4.1\r\n\tAUTHOR: Carl Webster (with a lot of help from Michael B. Smith and Jeff Wouters)\r\n\tLASTEDIT: January 19, 2013\r\n#&gt;\r\n\r\n#thanks to @jeffwouters and Michael B. Smith for helping me with these parameters\r\n[CmdletBinding(SupportsShouldProcess = $False, ConfirmImpact = \"None\", DefaultParameterSetName = \"Standard\") ]\r\n\r\nParam(\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 0, \r\n\tMandatory=$false )\r\n\t] \r\n\t[parameter(ParameterSetName=\"Summary\",\r\n\tPosition = 0, \r\n\tMandatory=$false )\r\n\t] \r\n\t[Alias(\"CN\")]\r\n\t[ValidateNotNullOrEmpty()]\r\n\t[string]$CompanyName=\"\",\r\n\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 1, \r\n\tMandatory=$false )\r\n\t] \r\n\t[parameter(ParameterSetName=\"Summary\",\r\n\tPosition = 1, \r\n\tMandatory=$false )\r\n\t] \r\n\t[Alias(\"CP\")]\r\n\t[ValidateNotNullOrEmpty()]\r\n\t[string]$CoverPage=\"Sideline\", \r\n\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 2, \r\n\tMandatory=$false )\r\n\t] \r\n\t[parameter(ParameterSetName=\"Summary\",\r\n\tPosition = 2, \r\n\tMandatory=$false )\r\n\t] \r\n\t[Alias(\"UN\")]\r\n\t[ValidateNotNullOrEmpty()]\r\n\t[string]$UserName=$env:username,\r\n\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 3, \r\n\tMandatory=$false )\r\n\t] \r\n\t[parameter(ParameterSetName=\"Summary\",\r\n\tPosition = 3, \r\n\tMandatory=$false )\r\n\t] \r\n\t[Switch]$PDF=$False,\r\n\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 4, \r\n\tMandatory=$false )\r\n\t] \r\n\t[Switch]$Hardware=$False, \r\n\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 5, \r\n\tMandatory=$false )\r\n\t] \r\n\t[Switch]$Software=$False,\r\n\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 6, \r\n\tMandatory=$False)\r\n\t] \r\n\t[Datetime]$StartDate = ((Get-Date -displayhint date).AddDays(-7)),\r\n\r\n\t[parameter(ParameterSetName=\"Standard\",\r\n\tPosition = 7, \r\n\tMandatory=$False)\r\n\t] \r\n\t[Datetime]$EndDate = (Get-Date -displayhint date),\r\n\r\n\t[parameter(ParameterSetName=\"Summary\",\r\n\tPosition = 8, \r\n\tMandatory=$false )\r\n\t] \r\n\t[Switch]$Summary=$False\t\r\n\t)\r\n\r\n#force -verbose on\r\n$PSDefaultParameterValues = @{\"*:Verbose\"=$True}\r\nIf($Hardware -eq $Null)\r\n{\r\n\t$Hardware = $False\r\n}\r\nIf($Software -eq $Null)\r\n{\r\n\t$Software = $False\r\n}\t\r\nIf($Summary -eq $Null)\r\n{\r\n\t$Summary = $False\r\n}\r\n\r\n#Original Script created 8\/17\/2010 by Michael Bogobowicz, Citrix Systems.\r\n#To contact, please message @mikebogo on Twitter\r\n#This script is designed to be run on a XenApp 6.5 server\r\n\r\n#Modifications by Carl Webster, CTP and independent consultant\r\n#webster@carlwebster.com\r\n#@carlwebster on Twitter\r\n#http:\/\/www.CarlWebster.com\r\n#modified from the original script for XenApp 6.5\r\n#\tVersion 4 of script is based on version 3.17 of XA65 script\r\n#\tAdd ability to process AD based Citrix policies\r\n#\tAdd Appendix A for Session Sharing information\r\n#\tAdd Appendix B for Server Major Items\r\n#\tAdd descriptions for Citrix Policy filter type\r\n#\tAdd detecting the running Operating System to handle Word 2007 oddness with Server 2003\/2008 vs Windows 7 vs Server 2008 R2\r\n#\tAdd elapsed time to end of script\r\n#\tAdd extra testing for applications, load balancing policies and worker groups to report if none exist instead of issuing a warning\r\n#\tAdd get-date to all write-verbose statements\r\n#\tAdd missing \"None\" option to ICA\\Visual Display\\Moving Images\\Progressive compression level\r\n#\tAdd more Write-Verbose statements\r\n#\tAdd option to SaveAs PDF\r\n#\tAdd setting Default tab stops at 36 points (1\/2 inch in the USA)\r\n#\tAdd Software Inventory\r\n#\tAdd Summary Page\r\n#\tAdd support for non-English versions of Microsoft Word\r\n#\tAdd WMI hardware information for Computer System, Disks, Processor and Network Interface Cards\r\n#\tChange all instances of using $Word.Quit() to also use proper garbage collection\r\n#\tChange all occurrences of Access Session Conditions to Tables \r\n#\tChange Default Cover Page to Sideline since Motion is not in German Word\r\n#\tChange Get-RegistryValue function to handle $null return value\r\n#\tChange most $Global: variables to regular variables\r\n#\tChange the test for the existence of XA65ConfigLog.udl from using .\\ to $pwd.path\r\n#\tChange wording of not being able to load the Citrix.GroupPolicy.Commands.psm1 module\r\n#\tChange wording when script aborts from a blank company name\r\n#\tFix issues with Word 2007 SaveAs under (Server 2008 and Windows 7) and Server 2008 R2\r\n#\tFix logic error when comparing Citrix installed hotfixes to the recommended list\r\n#\tFix output and missing items from ICA\\Printing\\Client Printers\\Printer driver mapping and compatibility\r\n#\tFix output of ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash URL compatibility list\r\n#\tFix output of ICA\\MultiStream Connections\\Multi-Port Policy\r\n#\tFix output of ICA\\Printing\\Drivers\\Universal driver preference\r\n#\tFix output of ICA\\Printing\\Session printers\r\n#\tFix output of ICA\\Printing\\Universal Printing\\Universal printing optimization defaults\r\n#\tFix output of Server Settings\\Health Monitoring and Recovery\\Health monitoring tests\r\n#\tFix WaitForPrintersToBeCreated policy setting\r\n#\tFixing ICA\\Printing\\Session printers and ICA\\Printing\\Client Printers\\Printer driver mapping and compatibility  required a new Function Get-PrinterModifiedSettings to keep from having duplicate code from Session Printers\r\n#\tAbort script if Farm information cannot be retrieved\r\n#\tAlign Tables on Tab stop boundaries\r\n#\tConsolidated all the code to properly abort the script into a function AbortScript\r\n#\tForce the -verbose common parameter to be $True if running PoSH V3 and later\r\n#\tGeneral code cleanup\r\n#\tIf cover page selected does not exist, abort script\r\n#\tIf running Word 2007 and the Save As PDF option is selected then verify the Save As PDF add-in is installed.  Abort script if not installed.\r\n#\tIn the Server section, change Published Application to a Table\r\n#\tLoad Balancing Policies: fixed display of \"Apply to connections made through Access Gateway\" and \"Configure application connection preference based on worker group\"\r\n#\tOnly process WMI hardware information if the server is online\r\n#\tStrongly type all possible variables\r\n#\tUpdate for changes to CTX129229\r\n#\tVerify Get-HotFix cmdlet worked.  If not, write error and suggestion to document\r\n#\tVerify Word object is created.  If not, write error &amp; suggestion to document and abort script\r\n#Updated 07-Nov-2013\r\n#\tChanged link to Citrix.GroupPolicy.Commands.psm module to my Dropbox\r\n#\tChanged the GetCtxGPOsInAD function to work in a Windows Workgroup environment\r\n#\tRemoved the .LINK section from the help text\r\n#\tThe Hotfix array for Citrix hotfixes was not initialized correctly causing all installed Citrix hotfixes to show as not installed.\r\n#Updated 12-Nov-2013\r\n#\tAdded back in the French sections that somehow got removed\r\n#Version 4.1 Updates and fixes:\r\n#\tAdded additional error checking when retrieving Network Interface WMI data\r\n#\tAdded additional Write-Verbose statements for the AD policy function\r\n#\tAdded beginning and ending dates for retrieving Configuration Logging data\r\n#\tAdded four policy settings that are only for AD based Citrix policies\r\n#\tAdded help text to show the script produces a Word or PDF document\r\n#\tAdded help text to show the Summary option cannot be used with either the Software or Hardware options\r\n#\tAdded Parameter sets to support the Summary option\r\n#\tAdded Summary report option\r\n#\tChanged Configuration Logging section to a Word table\r\n#\tChanged to using $PSCulture for Word culture setting\r\n#\tDon't abort script if Cover Page is not found\r\n#\tFixed bug where the AD Policy function did not work if there was only one AD policy\r\n#\tFor applications, move list of servers and worker groups to table\r\n#\tFor the software inventory add DisplayVersion to the table\r\n#\tFor Worker Groups, move list of servers and applications to table\r\n#\tFunction, validStateProp, created by Michael B. Smith to handle \"property cannot be found on this object\" error on Mobile Experience policy settings\r\n#\tIf remoting is used, verify that remoting server is not in session-only mode\r\n#\tIn Appendix B, if the License Server cell is empty replace with the text \"Set by policy\"\r\n#\tOnly include Valid hotfixes in the table of installed Citrix hotfixes\r\n#\tRemoved the Valid column for the Citrix hotfix table\r\n#\tRemoved the extra blank line between Administrators\r\n#\tThe XenApp 6.5 Mobility Pack added a new User policy node with three settings\r\n#\tUpdated for CTX129229 that was updated on 31-Dec-2013\r\n\r\nSet-StrictMode -Version 2\r\n\r\n#the following values were attained from \r\n#http:\/\/groovy.codehaus.org\/modules\/scriptom\/1.6.0\/scriptom-office-2K3-tlb\/apidocs\/\r\n#http:\/\/msdn.microsoft.com\/en-us\/library\/office\/aa211923(v=office.11).aspx\r\n[int]$wdAlignPageNumberRight = 2\r\n[long]$wdColorGray15 = 14277081\r\n[long]$wdColorGray05 = 15987699 \r\n[int]$wdMove = 0\r\n[int]$wdSeekMainDocument = 0\r\n[int]$wdSeekPrimaryFooter = 4\r\n[int]$wdStory = 6\r\n[int]$wdColorRed = 255\r\n[int]$wdColorBlack = 0\r\n[int]$wdWord2007 = 12\r\n[int]$wdWord2010 = 14\r\n[int]$wdWord2013 = 15\r\n[int]$wdSaveFormatPDF = 17\r\n[int]$wdCaptionPositionAbove  = 0\r\n[int]$wdCaptionTable  = -2\r\n[bool]$wdExcludeLabel = $True\r\n[string]$wdTitleAutoText = \"\"\r\n[string]$RunningOS = (Get-WmiObject -class Win32_OperatingSystem).Caption\r\n\r\n$hash = @{}\r\n\r\n# DE and FR translations for Word 2010 by Vladimir Radojevic\r\n# Vladimir.Radojevic@Commerzreal.com\r\n\r\n# DA translations for Word 2010 by Thomas Daugaard\r\n# Citrix Infrastructure Specialist at edgemo A\/S\r\n\r\n# CA translations by Javier Sanchez \r\n# CEO &amp; Founder 101 Consulting\r\n\r\n#ca - Catalan\r\n#da - Danish\r\n#de - German\r\n#en - English\r\n#es - Spanish\r\n#fi - Finnish\r\n#fr - French\r\n#nb - Norwegian\r\n#nl - Dutch\r\n#pt - Portuguese\r\n#sv - Swedish\r\n\r\nSwitch ($PSCulture.Substring(0,3))\r\n{\r\n\t'ca-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Taula autom\u00c3\u00a1tica 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'da-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Automatisk tabel 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'de-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Automatische Tabelle 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'en-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents'  = 'Automatic Table 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'es-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Tabla autom\u00c3\u00a1tica 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'fi-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Automaattinen taulukko 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'fr-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Sommaire Automatique 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'nb-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Automatisk tabell 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'nl-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Automatische inhoudsopgave 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'pt-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Sum\u00c3\u00a1rio Autom\u00c3\u00a1tico 2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'sv-'\t{\r\n\t\t\t$hash.($($PSCulture)) = @{\r\n\t\t\t\t'Word_TableOfContents' = 'Automatisk inneh\u00c3\u00a5llsf\u00c3\u00b6rteckning2';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\tDefault\t{$hash.('en-US') = @{\r\n\t\t\t\t'Word_TableOfContents'  = 'Automatic Table 2';\r\n\t\t\t}\r\n\t\t}\r\n}\r\n\r\n# http:\/\/www.thedoctools.com\/index.php?show=wt_style_names_english_danish_german_french\r\n[int]$wdStyleHeading1 = -2\r\n[int]$wdStyleHeading2 = -3\r\n[int]$wdStyleHeading3 = -4\r\n[int]$wdStyleHeading4 = -5\r\n[int]$wdStyleNoSpacing = -158\r\n[int]$wdTableGrid = -155\r\n\r\n$myHash = $hash.$PSCulture\r\n\r\nIf($myHash -eq $Null)\r\n{\r\n\t$myHash = $hash.('en-US')\r\n}\r\n\r\n$myHash.Word_NoSpacing = $wdStyleNoSpacing\r\n$myHash.Word_Heading1 = $wdStyleheading1\r\n$myHash.Word_Heading2 = $wdStyleheading2\r\n$myHash.Word_Heading3 = $wdStyleheading3\r\n$myHash.Word_Heading4 = $wdStyleheading4\r\n$myHash.Word_TableGrid = $wdTableGrid\r\n\r\nFunction ValidateCoverPage\r\n{\r\n\tParam([int]$xWordVersion, [string]$xCP)\r\n\r\n\t$xArray = \"\"\r\n\r\n\tSwitch ($PSCulture.Substring(0,3))\r\n\t{\r\n\t\t'ca-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Austin\", \"En bandes\", \"Faceta\", \"Filigrana\",\r\n\t\t\t\t\t\"Integral\", \"I\u00c3\u00b3 (clar)\", \"I\u00c3\u00b3 (fosc)\", \"L\u00c3\u00adnia lateral\",\r\n\t\t\t\t\t\"Moviment\", \"Quadr\u00c3\u00adcula\", \"Retrospectiu\", \"Sector (clar)\",\r\n\t\t\t\t\t\"Sector (fosc)\", \"Sem\u00c3\u00a0for\", \"Visualitzaci\u00c3\u00b3\", \"Whisp\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabet\", \"Anual\", \"Austin\", \"Conservador\",\r\n\t\t\t\t\t\"Contrast\", \"Cubicles\", \"Diplom\u00c3\u00a0tic\", \"Exposici\u00c3\u00b3\",\r\n\t\t\t\t\t\"L\u00c3\u00adnia lateral\", \"Mod\", \"Mosiac\", \"Moviment\", \"Paper de diari\",\r\n\t\t\t\t\t\"Perspectiva\", \"Piles\", \"Quadr\u00c3\u00adcula\", \"Sobri\",\r\n\t\t\t\t\t\"Transcendir\", \"Trencaclosques\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabet\", \"Anual\", \"Conservador\", \"Contrast\",\r\n\t\t\t\t\t\"Cubicles\", \"Diplom\u00c3\u00a0tic\", \"En mosaic\", \"Exposici\u00c3\u00b3\", \"L\u00c3\u00adnia lateral\",\r\n\t\t\t\t\t\"Mod\", \"Moviment\", \"Piles\", \"Sobri\", \"Transcendir\", \"Trencaclosques\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'da-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Bev\u00c3\u00a6gElse\", \"Brusen\", \"Ion (lys)\", \"Filigran\",\r\n\t\t\t\t\t\"Retro\", \"Semafor\", \"Visningsmaster\", \"Integral\",\r\n\t\t\t\t\t\"Facet\", \"Gitter\", \"Stribet\", \"Sidelinje\", \"Udsnit (lys)\",\r\n\t\t\t\t\t\"Udsnit (m\u00c3\u00b8rk)\", \"Ion (m\u00c3\u00b8rk)\", \"Austin\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Bev\u00c3\u00a6gElse\", \"Moderat\", \"Perspektiv\", \"Firkanter\",\r\n\t\t\t\t\t\"Overskrid\", \"Alfabet\", \"Kontrast\", \"Stakke\", \"Fliser\", \"G\u00c3\u00a5de\",\r\n\t\t\t\t\t\"Gitter\", \"Austin\", \"Eksponering\", \"Sidelinje\", \"Enkel\",\r\n\t\t\t\t\t\"N\u00c3\u00a5lestribet\", \"\u00c3\u2026rlig\", \"Avispapir\", \"Tradionel\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabet\", \"\u00c3\u2026rlig\", \"Bev\u00c3\u00a6gElse\", \"Eksponering\",\r\n\t\t\t\t\t\"Enkel\", \"Firkanter\", \"Fliser\", \"G\u00c3\u00a5de\", \"Kontrast\",\r\n\t\t\t\t\t\"Mod\", \"N\u00c3\u00a5lestribet\", \"Overskrid\", \"Sidelinje\", \"Stakke\",\r\n\t\t\t\t\t\"Tradionel\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'de-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Semaphor\", \"Segment (hell)\", \"Ion (hell)\",\r\n\t\t\t\t\t\"Raster\", \"Ion (dunkel)\", \"Filigran\", \"R\u00c3\u00bcckblick\", \"Pfiff\",\r\n\t\t\t\t\t\"ViewMaster\", \"Segment (dunkel)\", \"Verbunden\", \"Bewegung\",\r\n\t\t\t\t\t\"Randlinie\", \"Austin\", \"Integral\", \"Facette\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alphabet\", \"Austin\", \"Bewegung\", \"Durchscheinend\",\r\n\t\t\t\t\t\"Herausgestellt\", \"J\u00c3\u00a4hrlich\", \"Kacheln\", \"Kontrast\", \"Kubistisch\",\r\n\t\t\t\t\t\"Modern\", \"Nadelstreifen\", \"Perspektive\", \"Puzzle\", \"Randlinie\",\r\n\t\t\t\t\t\"Raster\", \"Schlicht\", \"Stapel\", \"Traditionell\", \"Zeitungspapier\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alphabet\", \"Bewegung\", \"Durchscheinend\", \"Herausgestellt\",\r\n\t\t\t\t\t\"J\u00c3\u00a4hrlich\", \"Kacheln\", \"Kontrast\", \"Kubistisch\", \"Modern\",\r\n\t\t\t\t\t\"Nadelstreifen\", \"Puzzle\", \"Randlinie\", \"Raster\", \"Schlicht\", \"Stapel\",\r\n\t\t\t\t\t\"Traditionell\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'en-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Austin\", \"Banded\", \"Facet\", \"Filigree\", \"Grid\",\r\n\t\t\t\t\t\"Integral\", \"Ion (Dark)\", \"Ion (Light)\", \"Motion\", \"Retrospect\",\r\n\t\t\t\t\t\"Semaphore\", \"Sideline\", \"Slice (Dark)\", \"Slice (Light)\", \"ViewMaster\",\r\n\t\t\t\t\t\"Whisp\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alphabet\", \"Annual\", \"Austere\", \"Austin\", \"Conservative\",\r\n\t\t\t\t\t\"Contrast\", \"Cubicles\", \"Exposure\", \"Grid\", \"Mod\", \"Motion\", \"Newsprint\",\r\n\t\t\t\t\t\"Perspective\", \"Pinstripes\", \"Puzzle\", \"Sideline\", \"Stacks\", \"Tiles\", \"Transcend\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alphabet\", \"Annual\", \"Austere\", \"Conservative\", \"Contrast\",\r\n\t\t\t\t\t\"Cubicles\", \"Exposure\", \"Mod\", \"Motion\", \"Pinstripes\", \"Puzzle\",\r\n\t\t\t\t\t\"Sideline\", \"Stacks\", \"Tiles\", \"Transcend\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'es-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Whisp\", \"Vista principal\", \"Filigrana\", \"Austin\",\r\n\t\t\t\t\t\"Slice (luz)\", \"Faceta\", \"Sem\u00c3\u00a1foro\", \"Retrospectiva\", \"Cuadr\u00c3\u00adcula\",\r\n\t\t\t\t\t\"Movimiento\", \"Cortar (oscuro)\", \"L\u00c3\u00adnea lateral\", \"Ion (oscuro)\",\r\n\t\t\t\t\t\"Ion (claro)\", \"Integral\", \"Con bandas\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabeto\", \"Anual\", \"Austero\", \"Austin\", \"Conservador\",\r\n\t\t\t\t\t\"Contraste\", \"Cuadr\u00c3\u00adcula\", \"Cub\u00c3\u00adculos\", \"Exposici\u00c3\u00b3n\", \"L\u00c3\u00adnea lateral\",\r\n\t\t\t\t\t\"Moderno\", \"Mosaicos\", \"Movimiento\", \"Papel peri\u00c3\u00b3dico\",\r\n\t\t\t\t\t\"Perspectiva\", \"Pilas\", \"Puzzle\", \"Rayas\", \"Sobrepasar\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabeto\", \"Anual\", \"Austero\", \"Conservador\",\r\n\t\t\t\t\t\"Contraste\", \"Cub\u00c3\u00adculos\", \"Exposici\u00c3\u00b3n\", \"L\u00c3\u00adnea lateral\",\r\n\t\t\t\t\t\"Moderno\", \"Mosaicos\", \"Movimiento\", \"Pilas\", \"Puzzle\",\r\n\t\t\t\t\t\"Rayas\", \"Sobrepasar\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'fi-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Filigraani\", \"Integraali\", \"Ioni (tumma)\",\r\n\t\t\t\t\t\"Ioni (vaalea)\", \"Opastin\", \"Pinta\", \"Retro\", \"Sektori (tumma)\",\r\n\t\t\t\t\t\"Sektori (vaalea)\", \"Vaihtuvav\u00c3\u00a4rinen\", \"ViewMaster\", \"Austin\",\r\n\t\t\t\t\t\"Kiehkura\", \"Liike\", \"Ruudukko\", \"Sivussa\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Aakkoset\", \"Askeettinen\", \"Austin\", \"Kontrasti\",\r\n\t\t\t\t\t\"Laatikot\", \"Liike\", \"Liituraita\", \"Mod\", \"Osittain peitossa\",\r\n\t\t\t\t\t\"Palapeli\", \"Perinteinen\", \"Perspektiivi\", \"Pinot\", \"Ruudukko\",\r\n\t\t\t\t\t\"Ruudut\", \"Sanomalehtipaperi\", \"Sivussa\", \"Vuotuinen\", \"Ylitys\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Aakkoset\", \"Alttius\", \"Kontrasti\", \"Kuvakkeet ja tiedot\",\r\n\t\t\t\t\t\"Liike\" , \"Liituraita\" , \"Mod\" , \"Palapeli\", \"Perinteinen\", \"Pinot\",\r\n\t\t\t\t\t\"Sivussa\", \"Ty\u00c3\u00b6pisteet\", \"Vuosittainen\", \"Yksinkertainen\", \"Ylitys\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'fr-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"ViewMaster\", \"Secteur (fonc\u00c3\u00a9)\", \"S\u00c3\u00a9maphore\",\r\n\t\t\t\t\t\"R\u00c3\u00a9trospective\", \"Ion (fonc\u00c3\u00a9)\", \"Ion (clair)\", \"Int\u00c3\u00a9grale\",\r\n\t\t\t\t\t\"Filigrane\", \"Facette\", \"Secteur (clair)\", \"\u00c3\u20ac bandes\", \"Austin\",\r\n\t\t\t\t\t\"Guide\", \"Whisp\", \"Lignes lat\u00c3\u00a9rales\", \"Quadrillage\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Mosa\u00c3\u00afques\", \"Ligne lat\u00c3\u00a9rale\", \"Annuel\", \"Perspective\",\r\n\t\t\t\t\t\"Contraste\", \"Emplacements de bureau\", \"Moderne\", \"Blocs empil\u00c3\u00a9s\",\r\n\t\t\t\t\t\"Rayures fines\", \"Aust\u00c3\u00a8re\", \"Transcendant\", \"Classique\", \"Quadrillage\",\r\n\t\t\t\t\t\"Exposition\", \"Alphabet\", \"Mots crois\u00c3\u00a9s\", \"Papier journal\", \"Austin\", \"Guide\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alphabet\", \"Annuel\", \"Aust\u00c3\u00a8re\", \"Blocs empil\u00c3\u00a9s\", \"Blocs superpos\u00c3\u00a9s\",\r\n\t\t\t\t\t\"Classique\", \"Contraste\", \"Exposition\", \"Guide\", \"Ligne lat\u00c3\u00a9rale\", \"Moderne\",\r\n\t\t\t\t\t\"Mosa\u00c3\u00afques\", \"Mots crois\u00c3\u00a9s\", \"Rayures fines\", \"Transcendant\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'nb-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Austin\", \"BevegElse\", \"Dempet\", \"Fasett\", \"Filigran\",\r\n\t\t\t\t\t\"Integral\", \"Ion (lys)\", \"Ion (m\u00c3\u00b8rk)\", \"Retrospekt\", \"Rutenett\",\r\n\t\t\t\t\t\"Sektor (lys)\", \"Sektor (m\u00c3\u00b8rk)\", \"Semafor\", \"Sidelinje\", \"Stripet\",\r\n\t\t\t\t\t\"ViewMaster\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabet\", \"\u00c3\u2026rlig\", \"Avistrykk\", \"Austin\", \"Avlukker\",\r\n\t\t\t\t\t\"BevegElse\", \"Engasjement\", \"Enkel\", \"Fliser\", \"Konservativ\",\r\n\t\t\t\t\t\"Kontrast\", \"Mod\", \"Perspektiv\", \"Puslespill\", \"Rutenett\", \"Sidelinje\",\r\n\t\t\t\t\t\"Smale striper\", \"Stabler\", \"Transcenderende\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabet\", \"\u00c3\u2026rlig\", \"Avlukker\", \"BevegElse\", \"Engasjement\",\r\n\t\t\t\t\t\"Enkel\", \"Fliser\", \"Konservativ\", \"Kontrast\", \"Mod\", \"Puslespill\",\r\n\t\t\t\t\t\"Sidelinje\", \"Smale striper\", \"Stabler\", \"Transcenderende\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'nl-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Austin\", \"Beweging\", \"Facet\", \"Filigraan\", \"Gestreept\",\r\n\t\t\t\t\t\"Integraal\", \"Ion (donker)\", \"Ion (licht)\", \"Raster\",\r\n\t\t\t\t\t\"Segment (Light)\", \"Semafoor\", \"Slice (donker)\", \"Spriet\",\r\n\t\t\t\t\t\"Terugblik\", \"Terzijde\", \"ViewMaster\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Aantrekkelijk\", \"Alfabet\", \"Austin\", \"Bescheiden\",\r\n\t\t\t\t\t\"Beweging\", \"Blikvanger\", \"Contrast\", \"Eenvoudig\", \"Jaarlijks\",\r\n\t\t\t\t\t\"Krantenpapier\", \"Krijtstreep\", \"Kubussen\", \"Mod\", \"Perspectief\",\r\n\t\t\t\t\t\"Puzzel\", \"Raster\", \"Stapels\",\r\n\t\t\t\t\t\"Tegels\", \"Terzijde\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Aantrekkelijk\", \"Alfabet\", \"Bescheiden\", \"Beweging\",\r\n\t\t\t\t\t\"Blikvanger\", \"Contrast\", \"Eenvoudig\", \"Jaarlijks\", \"Krijtstreep\",\r\n\t\t\t\t\t\"Mod\", \"Puzzel\", \"Stapels\", \"Tegels\", \"Terzijde\", \"Werkplekken\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'pt-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Anima\u00c3\u00a7\u00c3\u00a3o\", \"Austin\", \"Em Tiras\", \"Exibi\u00c3\u00a7\u00c3\u00a3o Mestra\",\r\n\t\t\t\t\t\"Faceta\", \"Fatia (Clara)\", \"Fatia (Escura)\", \"Filete\", \"Filigrana\",\r\n\t\t\t\t\t\"Grade\", \"Integral\", \"\u00c3\u008don (Claro)\", \"\u00c3\u008don (Escuro)\", \"Linha Lateral\",\r\n\t\t\t\t\t\"Retrospectiva\", \"Sem\u00c3\u00a1foro\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabeto\", \"Anima\u00c3\u00a7\u00c3\u00a3o\", \"Anual\", \"Austero\", \"Austin\", \"Baias\",\r\n\t\t\t\t\t\"Conservador\", \"Contraste\", \"Exposi\u00c3\u00a7\u00c3\u00a3o\", \"Grade\", \"Ladrilhos\",\r\n\t\t\t\t\t\"Linha Lateral\", \"Listras\", \"Mod\", \"Papel Jornal\", \"Perspectiva\", \"Pilhas\",\r\n\t\t\t\t\t\"Quebra-cabe\u00c3\u00a7a\", \"Transcend\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabeto\", \"Anima\u00c3\u00a7\u00c3\u00a3o\", \"Anual\", \"Austero\", \"Baias\", \"Conservador\",\r\n\t\t\t\t\t\"Contraste\", \"Exposi\u00c3\u00a7\u00c3\u00a3o\", \"Ladrilhos\", \"Linha Lateral\", \"Listras\", \"Mod\",\r\n\t\t\t\t\t\"Pilhas\", \"Quebra-cabe\u00c3\u00a7a\", \"Transcendente\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t'sv-'\t{\r\n\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Austin\", \"Band\", \"Fasett\", \"Filigran\", \"Integrerad\", \"Jon (ljust)\",\r\n\t\t\t\t\t\"Jon (m\u00c3\u00b6rkt)\", \"Knippe\", \"Rutn\u00c3\u00a4t\", \"R\u00c3\u00b6rElse\", \"Sektor (ljus)\", \"Sektor (m\u00c3\u00b6rk)\",\r\n\t\t\t\t\t\"Semafor\", \"Sidlinje\", \"VisaHuvudsida\", \"\u00c3\u2026terblick\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabetm\u00c3\u00b6nster\", \"Austin\", \"Enkelt\", \"Exponering\", \"Konservativt\",\r\n\t\t\t\t\t\"Kontrast\", \"Kritstreck\", \"Kuber\", \"Perspektiv\", \"Plattor\", \"Pussel\", \"Rutn\u00c3\u00a4t\",\r\n\t\t\t\t\t\"R\u00c3\u00b6rElse\", \"Sidlinje\", \"Sobert\", \"Staplat\", \"Tidningspapper\", \"\u00c3\u2026rligt\",\r\n\t\t\t\t\t\"\u00c3\u2013verg\u00c3\u00a5ende\")\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xArray = (\"Alfabetm\u00c3\u00b6nster\", \"\u00c3\u2026rligt\", \"Enkelt\", \"Exponering\", \"Konservativt\",\r\n\t\t\t\t\t\"Kontrast\", \"Kritstreck\", \"Kuber\", \"\u00c3\u2013verg\u00c3\u00a5ende\", \"Plattor\", \"Pussel\", \"R\u00c3\u00b6rElse\",\r\n\t\t\t\t\t\"Sidlinje\", \"Sobert\", \"Staplat\")\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\tDefault\t{\r\n\t\t\t\t\tIf($xWordVersion -eq $wdWord2013)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$xArray = (\"Austin\", \"Banded\", \"Facet\", \"Filigree\", \"Grid\", \"Integral\",\r\n\t\t\t\t\t\t\"Ion (Dark)\", \"Ion (Light)\", \"Motion\", \"Retrospect\", \"Semaphore\",\r\n\t\t\t\t\t\t\"Sideline\", \"Slice (Dark)\", \"Slice (Light)\", \"ViewMaster\", \"Whisp\")\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElseIf($xWordVersion -eq $wdWord2010)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$xArray = (\"Alphabet\", \"Annual\", \"Austere\", \"Austin\", \"Conservative\",\r\n\t\t\t\t\t\t\"Contrast\", \"Cubicles\", \"Exposure\", \"Grid\", \"Mod\", \"Motion\", \"Newsprint\",\r\n\t\t\t\t\t\t\"Perspective\", \"Pinstripes\", \"Puzzle\", \"Sideline\", \"Stacks\", \"Tiles\", \"Transcend\")\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElseIf($xWordVersion -eq $wdWord2007)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$xArray = (\"Alphabet\", \"Annual\", \"Austere\", \"Conservative\", \"Contrast\",\r\n\t\t\t\t\t\t\"Cubicles\", \"Exposure\", \"Mod\", \"Motion\", \"Pinstripes\", \"Puzzle\",\r\n\t\t\t\t\t\t\"Sideline\", \"Stacks\", \"Tiles\", \"Transcend\")\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t}\r\n\r\n\tIf($xArray -contains $xCP)\r\n\t{\r\n\t\tReturn $True\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tReturn $False\r\n\t}\r\n}\r\n\r\nFunction GetComputerWMIInfo\r\n{\r\n\tParam([string]$RemoteComputerName)\r\n\r\n\t# original work by Kees Baggerman, \r\n\t# Senior Technical Consultant @ Inter Access\r\n\t# k.baggerman@myvirtualvision.com\r\n\t# @kbaggerman on Twitter\r\n\t# http:\/\/blog.myvirtualvision.com\r\n\r\n\t#Get Computer info\r\n\tWrite-Verbose \"$(Get-Date): `t`tProcessing WMI Computer information\"\r\n\tWrite-Verbose \"$(Get-Date): `t`t`tHardware information\"\r\n\tWriteWordLine 3 0 \"Computer Information\"\r\n\tWriteWordLine 0 1 \"General Computer\"\r\n\t[bool]$GotComputerItems = $True\r\n\r\n\tTry\r\n\t{\r\n\t\t$Results = Get-WmiObject -computername $RemoteComputerName win32_computersystem\r\n\t\t$ComputerItems = $Results | Select Manufacturer, Model, Domain, @{N=\"TotalPhysicalRam\"; E={[math]::round(($_.TotalPhysicalMemory \/ 1GB),0)}}\r\n\t\t$Results = $Null\r\n\t}\r\n\r\n\tCatch\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Get-WmiObject win32_computersystem failed for $($RemoteComputerName)\"\r\n\t\t$GotComputerItems = $False\r\n\t\tWrite-Warning \"Get-WmiObject win32_computersystem failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"Get-WmiObject win32_computersystem failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"On $($RemoteComputerName) you may need to run winmgmt \/verifyrepository and winmgmt \/salvagerepository\"\r\n\t}\r\n\r\n\tIf($GotComputerItems)\r\n\t{\r\n\t\tForEach($Item in $ComputerItems)\r\n\t\t{\r\n\t\t\tWriteWordLine 0 2 \"Manufacturer`t: \" $Item.manufacturer\r\n\t\t\tWriteWordLine 0 2 \"Model`t`t: \" $Item.model\r\n\t\t\tWriteWordLine 0 2 \"Domain`t`t: \" $Item.domain\r\n\t\t\tWriteWordLine 0 2 \"Total Ram`t: $($Item.totalphysicalram) GB\"\r\n\t\t\tWriteWordLine 0 2 \"\"\r\n\t\t}\r\n\t}\r\n\r\n\t#Get Disk info\r\n\tWrite-Verbose \"$(Get-Date): `t`t`tDrive information\"\r\n\tWriteWordLine 0 1 \"Drive(s)\"\r\n\t[bool]$GotDrives = $True\r\n\r\n\tTry\r\n\t{\r\n\t\t$Results = Get-WmiObject -computername $RemoteComputerName Win32_LogicalDisk\r\n\t\t$drives = $Results | select caption, @{N=\"drivesize\"; E={[math]::round(($_.size \/ 1GB),0)}}, \r\n\t\tfilesystem, @{N=\"drivefreespace\"; E={[math]::round(($_.freespace \/ 1GB),0)}}, \r\n\t\tvolumename, drivetype, volumedirty, volumeserialnumber\r\n\t\t$Results = $Null\r\n\t}\r\n\r\n\tCatch\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Get-WmiObject Win32_LogicalDisk failed for $($RemoteComputerName)\"\r\n\t\t$GotDrives = $False\r\n\t\tWrite-Warning \"Get-WmiObject Win32_LogicalDisk failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"Get-WmiObject Win32_LogicalDisk failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"On $($RemoteComputerName) you may need to run winmgmt \/verifyrepository and winmgmt \/salvagerepository\"\r\n\t}\r\n\r\n\tIf($GotDrives)\r\n\t{\r\n\t\tForEach($drive in $drives)\r\n\t\t{\r\n\t\t\tIf($drive.caption -ne \"A:\" -and $drive.caption -ne \"B:\")\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"Caption`t`t: \" $drive.caption\r\n\t\t\t\tWriteWordLine 0 2 \"Size`t`t: $($drive.drivesize) GB\"\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($drive.filesystem))\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"File System`t: \" $drive.filesystem\r\n\t\t\t\t}\r\n\t\t\t\tWriteWordLine 0 2 \"Free Space`t: $($drive.drivefreespace) GB\"\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($drive.volumename))\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Volume Name`t: \" $drive.volumename\r\n\t\t\t\t}\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($drive.volumedirty))\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Volume is Dirty`t: \" -nonewline\r\n\t\t\t\t\tIf($drive.volumedirty)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($drive.volumeserialnumber))\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Volume Serial #`t: \" $drive.volumeserialnumber\r\n\t\t\t\t}\r\n\t\t\t\tWriteWordLine 0 2 \"Drive Type`t: \" -nonewline\r\n\t\t\t\tSwitch ($drive.drivetype)\r\n\t\t\t\t{\r\n\t\t\t\t\t0\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t1\t{WriteWordLine 0 0 \"No Root Directory\"}\r\n\t\t\t\t\t2\t{WriteWordLine 0 0 \"Removable Disk\"}\r\n\t\t\t\t\t3\t{WriteWordLine 0 0 \"Local Disk\"}\r\n\t\t\t\t\t4\t{WriteWordLine 0 0 \"Network Drive\"}\r\n\t\t\t\t\t5\t{WriteWordLine 0 0 \"Compact Disc\"}\r\n\t\t\t\t\t6\t{WriteWordLine 0 0 \"RAM Disk\"}\r\n\t\t\t\t\tDefault {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t}\r\n\t\t\t\tWriteWordLine 0 2 \"\"\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t#Get CPU's and stepping\r\n\tWrite-Verbose \"$(Get-Date): `t`t`tProcessor information\"\r\n\tWriteWordLine 0 1 \"Processor(s)\"\r\n\t[bool]$GotProcessors = $True\r\n\r\n\tTry\r\n\t{\r\n\t\t$Results = Get-WmiObject -computername $RemoteComputerName win32_Processor\r\n\t\t$Processors = $Results | select availability, name, description, maxclockspeed, \r\n\t\tl2cachesize, l3cachesize, numberofcores, numberoflogicalprocessors\r\n\t\t$Results = $Null\r\n\t}\r\n\r\n\tCatch\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Get-WmiObject win32_Processor failed for $($RemoteComputerName)\"\r\n\t\t$GotProcessors = $False\r\n\t\tWrite-Warning \"Get-WmiObject win32_Processor failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"Get-WmiObject win32_Processor failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"On $($RemoteComputerName) you may need to run winmgmt \/verifyrepository and winmgmt \/salvagerepository\"\r\n\t}\r\n\r\n\tIf($GotProcessors)\r\n\t{\r\n\t\tForEach($processor in $processors)\r\n\t\t{\r\n\t\t\tWriteWordLine 0 2 \"Name`t`t`t: \" $processor.name\r\n\t\t\tWriteWordLine 0 2 \"Description`t`t: \" $processor.description\r\n\t\t\tWriteWordLine 0 2 \"Max Clock Speed`t: $($processor.maxclockspeed) MHz\"\r\n\t\t\tIf($processor.l2cachesize -gt 0)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"L2 Cache Size`t`t: $($processor.l2cachesize) KB\"\r\n\t\t\t}\r\n\t\t\tIf($processor.l3cachesize -gt 0)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"L3 Cache Size`t`t: $($processor.l3cachesize) KB\"\r\n\t\t\t}\r\n\t\t\tIf($processor.numberofcores -gt 0)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"# of Cores`t`t: \" $processor.numberofcores\r\n\t\t\t}\r\n\t\t\tIf($processor.numberoflogicalprocessors -gt 0)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"# of Logical Procs`t: \" $processor.numberoflogicalprocessors\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 2 \"Availability`t`t: \" -nonewline\r\n\t\t\tSwitch ($processor.availability)\r\n\t\t\t{\r\n\t\t\t\t1\t{WriteWordLine 0 0 \"Other\"}\r\n\t\t\t\t2\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t3\t{WriteWordLine 0 0 \"Running or Full Power\"}\r\n\t\t\t\t4\t{WriteWordLine 0 0 \"Warning\"}\r\n\t\t\t\t5\t{WriteWordLine 0 0 \"In Test\"}\r\n\t\t\t\t6\t{WriteWordLine 0 0 \"Not Applicable\"}\r\n\t\t\t\t7\t{WriteWordLine 0 0 \"Power Off\"}\r\n\t\t\t\t8\t{WriteWordLine 0 0 \"Off Line\"}\r\n\t\t\t\t9\t{WriteWordLine 0 0 \"Off Duty\"}\r\n\t\t\t\t10\t{WriteWordLine 0 0 \"Degraded\"}\r\n\t\t\t\t11\t{WriteWordLine 0 0 \"Not Installed\"}\r\n\t\t\t\t12\t{WriteWordLine 0 0 \"Install Error\"}\r\n\t\t\t\t13\t{WriteWordLine 0 0 \"Power Save - Unknown\"}\r\n\t\t\t\t14\t{WriteWordLine 0 0 \"Power Save - Low Power Mode\"}\r\n\t\t\t\t15\t{WriteWordLine 0 0 \"Power Save - Standby\"}\r\n\t\t\t\t16\t{WriteWordLine 0 0 \"Power Cycle\"}\r\n\t\t\t\t17\t{WriteWordLine 0 0 \"Power Save - Warning\"}\r\n\t\t\t\tDefault\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 2 \"\"\r\n\t\t}\r\n\t}\r\n\r\n\t#Get Nics\r\n\tWrite-Verbose \"$(Get-Date): `t`t`tNIC information\"\r\n\tWriteWordLine 0 1 \"Network Interface(s)\"\r\n\t[bool]$GotNics = $True\r\n\r\n\tTry\r\n\t{\r\n\t\t$Results = Get-WmiObject -computername $RemoteComputerName win32_networkadapterconfiguration \r\n\t\t$Nics = $Results | where {$_.ipenabled -eq $True}\r\n\t\t$Results = $Null\r\n\t}\r\n\r\n\tCatch\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Get-WmiObject win32_networkadapterconfiguration failed for $($RemoteComputerName)\"\r\n\t\t$GotNics = $False\r\n\t\tWrite-Warning \"Get-WmiObject win32_networkadapterconfiguration failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"Get-WmiObject win32_networkadapterconfiguration failed for $($RemoteComputerName)\"\r\n\t\tWriteWordLine 0 0 \"On $($RemoteComputerName) you may need to run winmgmt \/verifyrepository and winmgmt \/salvagerepository\"\r\n\t}\r\n\r\n\tIf( $Nics -eq $Null ) \r\n\t{ \r\n\t\t$GotNics = $False \r\n\t} \r\n\tElse \r\n\t{ \r\n\t\t$GotNics = !($Nics.__PROPERTY_COUNT -eq 0) \r\n\t} \r\n\r\n\tIf($GotNics)\r\n\t{\r\n\t\tForEach($nic in $nics)\r\n\t\t{\r\n\t\t\t$ThisNic = Get-WmiObject -computername $RemoteComputerName win32_networkadapter | where {$_.index -eq $nic.index}\r\n\t\t\tIf($ThisNic.Name -eq $nic.description)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"Name`t`t`t: \" $ThisNic.Name\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"Name`t`t`t: \" $ThisNic.Name\r\n\t\t\t\tWriteWordLine 0 2 \"Description`t`t: \" $nic.description\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 2 \"Connection ID`t`t: \" $ThisNic.NetConnectionID\r\n\t\t\tWriteWordLine 0 2 \"Manufacturer`t`t: \" $ThisNic.manufacturer\r\n\t\t\tWriteWordLine 0 2 \"Availability`t`t: \" -nonewline\r\n\t\t\tSwitch ($ThisNic.availability)\r\n\t\t\t{\r\n\t\t\t\t1\t{WriteWordLine 0 0 \"Other\"}\r\n\t\t\t\t2\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t3\t{WriteWordLine 0 0 \"Running or Full Power\"}\r\n\t\t\t\t4\t{WriteWordLine 0 0 \"Warning\"}\r\n\t\t\t\t5\t{WriteWordLine 0 0 \"In Test\"}\r\n\t\t\t\t6\t{WriteWordLine 0 0 \"Not Applicable\"}\r\n\t\t\t\t7\t{WriteWordLine 0 0 \"Power Off\"}\r\n\t\t\t\t8\t{WriteWordLine 0 0 \"Off Line\"}\r\n\t\t\t\t9\t{WriteWordLine 0 0 \"Off Duty\"}\r\n\t\t\t\t10\t{WriteWordLine 0 0 \"Degraded\"}\r\n\t\t\t\t11\t{WriteWordLine 0 0 \"Not Installed\"}\r\n\t\t\t\t12\t{WriteWordLine 0 0 \"Install Error\"}\r\n\t\t\t\t13\t{WriteWordLine 0 0 \"Power Save - Unknown\"}\r\n\t\t\t\t14\t{WriteWordLine 0 0 \"Power Save - Low Power Mode\"}\r\n\t\t\t\t15\t{WriteWordLine 0 0 \"Power Save - Standby\"}\r\n\t\t\t\t16\t{WriteWordLine 0 0 \"Power Cycle\"}\r\n\t\t\t\t17\t{WriteWordLine 0 0 \"Power Save - Warning\"}\r\n\t\t\t\tDefault\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 2 \"Physical Address`t: \" $nic.macaddress\r\n\t\t\tWriteWordLine 0 2 \"IP Address`t`t: \" $nic.ipaddress\r\n\t\t\tWriteWordLine 0 2 \"Default Gateway`t: \" $nic.Defaultipgateway\r\n\t\t\tWriteWordLine 0 2 \"Subnet Mask`t`t: \" $nic.ipsubnet\r\n\t\t\tIf($nic.dhcpenabled)\r\n\t\t\t{\r\n\t\t\t\t$DHCPLeaseObtainedDate = $nic.ConvertToDateTime($nic.dhcpleaseobtained)\r\n\t\t\t\t$DHCPLeaseExpiresDate = $nic.ConvertToDateTime($nic.dhcpleaseexpires)\r\n\t\t\t\tWriteWordLine 0 2 \"DHCP Enabled`t`t: \" $nic.dhcpenabled\r\n\t\t\t\tWriteWordLine 0 2 \"DHCP Lease Obtained`t: \" $dhcpleaseobtaineddate\r\n\t\t\t\tWriteWordLine 0 2 \"DHCP Lease Expires`t: \" $dhcpleaseexpiresdate\r\n\t\t\t\tWriteWordLine 0 2 \"DHCP Server`t`t:\" $nic.dhcpserver\r\n\t\t\t}\r\n\t\t\tIf(![String]::IsNullOrEmpty($nic.dnsdomain))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 2 \"DNS Domain`t`t: \" $nic.dnsdomain\r\n\t\t\t}\r\n\t\t\tIf($nic.dnsdomainsuffixsearchorder -ne $Null -and $nic.dnsdomainsuffixsearchorder.length -gt 0)\r\n\t\t\t{\r\n\t\t\t\t[int]$x = 1\r\n\t\t\t\tWriteWordLine 0 2 \"DNS Search Suffixes`t:\" -nonewline\r\n\t\t\t\tForEach($DNSDomain in $nic.dnsdomainsuffixsearchorder)\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($x -eq 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$x = 2\r\n\t\t\t\t\t\tWriteWordLine 0 0 \" $($DNSDomain)\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 5 \" $($DNSDomain)\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 2 \"DNS WINS Enabled`t: \" -nonewline\r\n\t\t\tIf($nic.dnsenabledforwinsresolution)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t}\r\n\t\t\tIf($nic.dnsserversearchorder -ne $Null -and $nic.dnsserversearchorder.length -gt 0)\r\n\t\t\t{\r\n\t\t\t\t[int]$x = 1\r\n\t\t\t\tWriteWordLine 0 2 \"DNS Servers`t`t:\" -nonewline\r\n\t\t\t\tForEach($DNSServer in $nic.dnsserversearchorder)\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($x -eq 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$x = 2\r\n\t\t\t\t\t\tWriteWordLine 0 0 \" $($DNSServer)\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 5 \" $($DNSServer)\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 2 \"NetBIOS Setting`t`t: \" -nonewline\r\n\t\t\tSwitch ($nic.TcpipNetbiosOptions)\r\n\t\t\t{\r\n\t\t\t\t0\t{WriteWordLine 0 0 \"Use NetBIOS setting from DHCP Server\"}\r\n\t\t\t\t1\t{WriteWordLine 0 0 \"Enable NetBIOS\"}\r\n\t\t\t\t2\t{WriteWordLine 0 0 \"Disable NetBIOS\"}\r\n\t\t\t\tDefault\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 2 \"WINS:\"\r\n\t\t\tWriteWordLine 0 3 \"Enabled LMHosts`t: \" -nonewline\r\n\t\t\tIf($nic.winsenablelmhostslookup)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t}\r\n\t\t\tIf(![String]::IsNullOrEmpty($nic.winshostlookupfile))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 3 \"Host Lookup File`t: \" $nic.winshostlookupfile\r\n\t\t\t}\r\n\t\t\tIf(![String]::IsNullOrEmpty($nic.winsprimaryserver))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 3 \"Primary Server`t`t: \" $nic.winsprimaryserver\r\n\t\t\t}\r\n\t\t\tIf(![String]::IsNullOrEmpty($nic.winssecondaryserver))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 3 \"Secondary Server`t: \" $nic.winssecondaryserver\r\n\t\t\t}\r\n\t\t\tIf(![String]::IsNullOrEmpty($nic.winsscopeid))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 3 \"Scope ID`t`t: \" $nic.winsscopeid\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tWriteWordLine 0 0 \"\"\r\n}\r\n\r\nFunction ConvertTo-ScriptBlock \r\n{\r\n\t#by Jeff Wouters, PowerShell MVP\r\n\tParam([string]$string)\r\n\t$ScriptBlock = $executioncontext.invokecommand.NewScriptBlock($string)\r\n\tReturn $ScriptBlock\r\n} \r\n\r\nFunction SWExclusions \r\n{\r\n\t# original work by Shaun Ritchie\r\n\t# performance improvements by Jeff Wouters, PowerShell MVP\r\n\t# modified by Webster\r\n\t# modified 3-jan-2014 to add displayversion\r\n\t$var = \"\"\r\n\t$Tmp = '$InstalledApps | Where-Object {'\r\n\t$Exclusions = Get-Content \"$($pwd.path)\\SoftwareExclusions.txt\" -EA 0\r\n\tIf($Exclusions -ne $Null -and $Exclusions.Count -gt 0)\r\n\t{\r\n\t\tForEach($Exclusion in $Exclusions) \r\n\t\t{\r\n\t\t\t$Tmp += \"(`$`_.DisplayName -notlike \"\"$($Exclusion)\"\") -and \"\r\n\t\t}\r\n\t\t$var += $Tmp.Substring(0,($Tmp.Length - 6))\r\n\t\t$var += \"} | Select-Object DisplayName, DisplayVersion | Sort DisplayName -unique\"\r\n\t}\r\n\treturn $var\r\n}\r\n\r\nFunction CheckWordPrereq\r\n{\r\n\tIf((Test-Path  REGISTRY::HKEY_CLASSES_ROOT\\Word.Application) -eq $False)\r\n\t{\r\n\t\tWrite-Host \"This script directly outputs to Microsoft Word, please install Microsoft Word\"\r\n\t\texit\r\n\t}\r\n\r\n\t#find out our session (usually \"1\" except on TS\/RDC or Citrix)\r\n\t$SessionID = (Get-Process -PID $PID).SessionId\r\n\r\n\t#Find out if winword is running in our session\r\n\t[bool]$wordrunning = ((Get-Process 'WinWord' -ea 0)|?{$_.SessionId -eq $SessionID}) -ne $Null\r\n\tIf($wordrunning)\r\n\t{\r\n\t\tWrite-Host \"Please close all instances of Microsoft Word before running this report.\"\r\n\t\texit\r\n\t}\r\n}\r\n\r\nFunction CheckWord2007SaveAsPDFInstalled\r\n{\r\n\tIf((Test-Path  REGISTRY::HKEY_CLASSES_ROOT\\Installer\\Products\\000021090B0090400000000000F01FEC) -eq $False)\r\n\t{\r\n\t\tWrite-Host \"Word 2007 is detected and the option to SaveAs PDF was selected but the Word 2007 SaveAs PDF add-in is not installed.\"\r\n\t\tWrite-Host \"The add-in can be downloaded from http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=9943\"\r\n\t\tWrite-Host \"Install the SaveAs PDF add-in and rerun the script.\"\r\n\t\tReturn $False\r\n\t}\r\n\tReturn $True\r\n}\r\n\r\nFunction ValidateCompanyName\r\n{\r\n\t[bool]$xResult = Test-RegistryValue \"HKCU:\\Software\\Microsoft\\Office\\Common\\UserInfo\" \"CompanyName\"\r\n\tIf($xResult)\r\n\t{\r\n\t\tReturn Get-RegistryValue \"HKCU:\\Software\\Microsoft\\Office\\Common\\UserInfo\" \"CompanyName\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t$xResult = Test-RegistryValue \"HKCU:\\Software\\Microsoft\\Office\\Common\\UserInfo\" \"Company\"\r\n\t\tIf($xResult)\r\n\t\t{\r\n\t\t\tReturn Get-RegistryValue \"HKCU:\\Software\\Microsoft\\Office\\Common\\UserInfo\" \"Company\"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tReturn \"\"\r\n\t\t}\r\n\t}\r\n}\r\n\r\n#http:\/\/stackoverflow.com\/questions\/5648931\/test-if-registry-value-exists\r\n# This Function just gets $True or $False\r\nFunction Test-RegistryValue($path, $name)\r\n{\r\n\t$key = Get-Item -LiteralPath $path -EA 0\r\n\t$key -and $Null -ne $key.GetValue($name, $Null)\r\n}\r\n\r\n# Gets the specified registry value or $Null if it is missing\r\nFunction Get-RegistryValue($path, $name)\r\n{\r\n\t$key = Get-Item -LiteralPath $path -EA 0\r\n\tIf($key)\r\n\t{\r\n\t\t$key.GetValue($name, $Null)\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t$Null\r\n\t}\r\n}\r\n\r\nFunction MultiPortPolicyPriority\r\n{\r\n\tParam([int]$PriorityValue = 3)\r\n\r\n\tSwitch ($PriorityValue)\r\n\t{ \r\n\t\t0 {\"Very High\"} \r\n\t\t1 {\"High\"} \r\n\t\t2 {\"Medium\"} \r\n\t\t3 {\"Low\"} \r\n\t\tDefault {\"Unknown Priority Value\"}\r\n\t}\r\n\tReturn $PriorityValue\r\n}\r\n\r\nFunction ConvertNumberToTime\r\n{\r\n\tParam([int]$val = 0)\r\n\r\n\t#this is stored as a number between 0 (00:00 AM) and 1439 (23:59 PM)\r\n\t#180 = 3AM\r\n\t#900 = 3PM\r\n\t#1027 = 5:07 PM\r\n\t#[int] (1027\/60) = 17 or 5PM\r\n\t#1027 % 60 leaves 7 or 7 minutes\r\n\r\n\t#thanks to MBS for the next line\r\n\t[int]$hour = [System.Math]::Floor(([int] $val) \/ ([int] 60))\r\n\t[int]$minute = $val % 60\r\n\t[string]$Strminute = $minute.ToString()\r\n\t[string]$tempminute = \"\"\r\n\tIf($Strminute.length -lt 2)\r\n\t{\r\n\t\t$tempMinute = \"0\" + $Strminute\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t$tempminute = $strminute\r\n\t}\r\n\t[string]$AMorPM = \"AM\"\r\n\tIf($Hour -ge 0 -and $Hour -le 11)\r\n\t{\r\n\t\t$AMorPM = \"AM\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t$AMorPM = \"PM\"\r\n\t\tIf($Hour -ge 12)\r\n\t\t{\r\n\t\t\t$Hour = $Hour - 12\r\n\t\t}\r\n\t}\r\n\tReturn \"$($hour):$($tempminute) $($AMorPM)\"\r\n}\r\n\r\nFunction ConvertIntegerToDate\r\n{\r\n\t#thanks to MBS for helping me on this Function\r\n\tParam([int]$DateAsInteger = 0)\r\n\r\n\t#this is stored as an integer but is actually a bitmask\r\n\t#01\/01\/2013 = 131924225 = 11111011101 00000001 00000001\r\n\t#01\/17\/2013 = 131924241 = 11111011101 00000001 00010001\r\n\t#\r\n\t# last 8 bits are the day\r\n\t# previous 8 bits are the month\r\n\t# the rest (up to 16) are the year\r\n\r\n\t[int]$year     = [Math]::Floor($DateAsInteger \/ 65536)\r\n\t[int]$month    = [Math]::Floor($DateAsInteger \/ 256) % 256\r\n\t[int]$day      = $DateAsInteger % 256\r\n\r\n\tReturn \"$Month\/$Day\/$Year\"\r\n}\r\n\r\nFunction Check-LoadedModule\r\n#Function created by Jeff Wouters\r\n#@JeffWouters on Twitter\r\n#modified by Michael B. Smith to handle when the module doesn't exist on server\r\n#modified by @andyjmorgan\r\n#bug fixed by @schose\r\n#bug fixed by Peter Bosen\r\n#This Function handles all three scenarios:\r\n#\r\n# 1. Module is already imported into current session\r\n# 2. Module is not already imported into current session, it does exists on the server and is imported\r\n# 3. Module does not exist on the server\r\n\r\n{\r\n\tParam([parameter(Mandatory = $True)][alias(\"Module\")][string]$ModuleName)\r\n\t#$LoadedModules = Get-Module | Select Name\r\n\t#following line changed at the recommendation of @andyjmorgan\r\n\t$LoadedModules = Get-Module |% { $_.Name.ToString() }\r\n\t#bug reported on 21-JAN-2013 by @schose \r\n\t#the following line did not work if the citrix.grouppolicy.commands.psm1 module\r\n\t#was manually loaded from a non Default folder\r\n\t#$ModuleFound = (!$LoadedModules -like \"*$ModuleName*\")\r\n\r\n\t[bool]$ModuleFound = ($LoadedModules -like \"*$ModuleName*\")\r\n\tIf(!$ModuleFound) \r\n\t{\r\n\t\t$module = Import-Module -Name $ModuleName -PassThru -EA 0\r\n\t\tIf($module -and $?)\r\n\t\t{\r\n\t\t\t# module imported properly\r\n\t\t\tReturn $True\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\t# module import failed\r\n\t\t\tReturn $False\r\n\t\t}\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t#module already imported into current session\r\n\t\tReturn $True\r\n\t}\r\n}\r\n\r\nFunction Check-NeededPSSnapins\r\n{\r\n\tParam([parameter(Mandatory = $True)][alias(\"Snapin\")][string[]]$Snapins)\r\n\r\n\t#Function specifics\r\n\t$MissingSnapins = @()\r\n\t[bool]$FoundMissingSnapin = $False\r\n\t$LoadedSnapins = @()\r\n\t$RegisteredSnapins = @()\r\n\r\n\t#Creates arrays of strings, rather than objects, we're passing strings so this will be more robust.\r\n\t$loadedSnapins += get-pssnapin | % {$_.name}\r\n\t$registeredSnapins += get-pssnapin -Registered | % {$_.name}\r\n\r\n\tForEach($Snapin in $Snapins)\r\n\t{\r\n\t\t#check if the snapin is loaded\r\n\t\tIf(!($LoadedSnapins -like $snapin))\r\n\t\t{\r\n\t\t\t#Check if the snapin is missing\r\n\t\t\tIf(!($RegisteredSnapins -like $Snapin))\r\n\t\t\t{\r\n\t\t\t\t#set the flag if it's not already\r\n\t\t\t\tIf(!($FoundMissingSnapin))\r\n\t\t\t\t{\r\n\t\t\t\t\t$FoundMissingSnapin = $True\r\n\t\t\t\t}\r\n\t\t\t\t#add the entry to the list\r\n\t\t\t\t$MissingSnapins += $Snapin\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t#Snapin is registered, but not loaded, loading it now:\r\n\t\t\t\tWrite-Host \"Loading Windows PowerShell snap-in: $snapin\"\r\n\t\t\t\tAdd-PSSnapin -Name $snapin -EA 0\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tIf($FoundMissingSnapin)\r\n\t{\r\n\t\tWrite-Warning \"Missing Windows PowerShell snap-ins Detected:\"\r\n\t\t$missingSnapins | % {Write-Warning \"($_)\"}\r\n\t\treturn $False\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tReturn $True\r\n\t}\r\n}\r\n\r\nFunction WriteWordLine\r\n#Function created by Ryan Revord\r\n#@rsrevord on Twitter\r\n#Function created to make output to Word easy in this script\r\n{\r\n\tParam([int]$style=0, [int]$tabs = 0, [string]$name = '', [string]$value = '', [string]$newline = \"'n\", [Switch]$nonewline)\r\n\t[string]$output = \"\"\r\n\t#Build output style\r\n\tSwitch ($style)\r\n\t{\r\n\t\t0 {$Selection.Style = $myHash.Word_NoSpacing}\r\n\t\t1 {$Selection.Style = $myHash.Word_Heading1}\r\n\t\t2 {$Selection.Style = $myHash.Word_Heading2}\r\n\t\t3 {$Selection.Style = $myHash.Word_Heading3}\r\n\t\t4 {$Selection.Style = $myHash.Word_Heading4}\r\n\t\tDefault {$Selection.Style = $myHash.Word_NoSpacing}\r\n\t}\r\n\t#build # of tabs\r\n\tWhile($tabs -gt 0)\r\n\t{ \r\n\t\t$output += \"`t\"; $tabs--; \r\n\t}\r\n\r\n\t#output the rest of the parameters.\r\n\t$output += $name + $value\r\n\t$Selection.TypeText($output)\r\n\r\n\t#test for new WriteWordLine 0.\r\n\tIf($nonewline)\r\n\t{\r\n\t\t# Do nothing.\r\n\t} \r\n\tElse \r\n\t{\r\n\t\t$Selection.TypeParagraph()\r\n\t}\r\n}\r\n\r\nFunction _SetDocumentProperty \r\n{\r\n\t#jeff hicks\r\n\tParam([object]$Properties,[string]$Name,[string]$Value)\r\n\t#get the property object\r\n\t$prop = $properties | ForEach { \r\n\t\t$propname=$_.GetType().InvokeMember(\"Name\",\"GetProperty\",$Null,$_,$Null)\r\n\t\tIf($propname -eq $Name) \r\n\t\t{\r\n\t\t\tReturn $_\r\n\t\t}\r\n\t} #ForEach\r\n\r\n\t#set the value\r\n\t$Prop.GetType().InvokeMember(\"Value\",\"SetProperty\",$Null,$prop,$Value)\r\n}\r\n\r\nFunction Get-PrinterModifiedSettings\r\n{\r\n\tParam([string]$Value, [string]$xelement, [bool]$xtable)\r\n\r\n\t[string]$ReturnStr = \"\"\r\n\r\n\tSwitch ($Value)\r\n\t{\r\n\t\t\"copi\" \r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Copies:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Copies`t`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp2 = $xelement.SubString($index + 1)\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"coll\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Collate:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Collate`t`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp2 = $xelement.SubString($index + 1)\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"scal\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Scale (%):\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Scale (%)`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp2 = $xelement.SubString($index + 1)\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"colo\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Color:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Color`t`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp1 = $xelement.SubString($index + 1)\r\n\t\t\t\tSwitch ($tmp1)\r\n\t\t\t\t{\r\n\t\t\t\t\t1 {$tmp2 = \"Monochrome\"}\r\n\t\t\t\t\t2 {$tmp2 = \"Color\"}\r\n\t\t\t\t\tDefault {$tmp2 = \"Color could not be determined: $($xelement)\"}\r\n\t\t\t\t}\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"prin\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Print Quality:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Print Quality`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp1 = $xelement.SubString($index + 1)\r\n\t\t\t\tSwitch ($tmp1)\r\n\t\t\t\t{\r\n\t\t\t\t\t-1 {$tmp2 = \"150 dpi\"}\r\n\t\t\t\t\t-2 {$tmp2 = \"300 dpi\"}\r\n\t\t\t\t\t-3 {$tmp2 = \"600 dpi\"}\r\n\t\t\t\t\t-4 {$tmp2 = \"1200 dpi\"}\r\n\t\t\t\t\tDefault \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp2 = \"Custom...`tX resolution: $tmp1\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"yres\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Y resolution:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Y resolution`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp2 = $xelement.SubString($index + 1)\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"orie\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Orientation:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Orientation`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp1 = $xelement.SubString($index + 1)\r\n\t\t\t\tSwitch ($tmp1)\r\n\t\t\t\t{\r\n\t\t\t\t\t\"portrait\"  {$tmp2 = \"Portrait\"}\r\n\t\t\t\t\t\"landscape\" {$tmp2 = \"Landscape\"}\r\n\t\t\t\t\tDefault {$tmp2 = \"Orientation could not be determined: $($xelement)\"}\r\n\t\t\t\t}\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"dupl\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Duplex:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Duplex`t`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp1 = $xelement.SubString($index + 1)\r\n\t\t\t\tSwitch ($tmp1)\r\n\t\t\t\t{\r\n\t\t\t\t\t1 {$tmp2 = \"Simplex\"}\r\n\t\t\t\t\t2 {$tmp2 = \"Vertical\"}\r\n\t\t\t\t\t3 {$tmp2 = \"Horizontal\"}\r\n\t\t\t\t\tDefault {$tmp2 = \"Duplex could not be determined: $($xelement)\"}\r\n\t\t\t\t}\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"pape\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Paper Size:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Paper Size`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp1 = $xelement.SubString($index + 1)\r\n\t\t\t\tSwitch ($tmp1)\r\n\t\t\t\t{\r\n\t\t\t\t\t1   {$tmp2 = \"Letter\"}\r\n\t\t\t\t\t2   {$tmp2 = \"Letter Small\"}\r\n\t\t\t\t\t3   {$tmp2 = \"Tabloid\"}\r\n\t\t\t\t\t4   {$tmp2 = \"Ledger\"}\r\n\t\t\t\t\t5   {$tmp2 = \"Legal\"}\r\n\t\t\t\t\t6   {$tmp2 = \"Statement\"}\r\n\t\t\t\t\t7   {$tmp2 = \"Executive\"}\r\n\t\t\t\t\t8   {$tmp2 = \"A3\"}\r\n\t\t\t\t\t9   {$tmp2 = \"A4\"}\r\n\t\t\t\t\t10  {$tmp2 = \"A4 Small\"}\r\n\t\t\t\t\t11  {$tmp2 = \"A5\"}\r\n\t\t\t\t\t12  {$tmp2 = \"B4 (JIS)\"}\r\n\t\t\t\t\t13  {$tmp2 = \"B5 (JIS)\"}\r\n\t\t\t\t\t14  {$tmp2 = \"Folio\"}\r\n\t\t\t\t\t15  {$tmp2 = \"Quarto\"}\r\n\t\t\t\t\t16  {$tmp2 = \"10X14\"}\r\n\t\t\t\t\t17  {$tmp2 = \"11X17\"}\r\n\t\t\t\t\t18  {$tmp2 = \"Note\"}\r\n\t\t\t\t\t19  {$tmp2 = \"Envelope #9\"}\r\n\t\t\t\t\t20  {$tmp2 = \"Envelope #10\"}\r\n\t\t\t\t\t21  {$tmp2 = \"Envelope #11\"}\r\n\t\t\t\t\t22  {$tmp2 = \"Envelope #12\"}\r\n\t\t\t\t\t23  {$tmp2 = \"Envelope #14\"}\r\n\t\t\t\t\t24  {$tmp2 = \"C Size Sheet\"}\r\n\t\t\t\t\t25  {$tmp2 = \"D Size Sheet\"}\r\n\t\t\t\t\t26  {$tmp2 = \"E Size Sheet\"}\r\n\t\t\t\t\t27  {$tmp2 = \"Envelope DL\"}\r\n\t\t\t\t\t28  {$tmp2 = \"Envelope C5\"}\r\n\t\t\t\t\t29  {$tmp2 = \"Envelope C3\"}\r\n\t\t\t\t\t30  {$tmp2 = \"Envelope C4\"}\r\n\t\t\t\t\t31  {$tmp2 = \"Envelope C6\"}\r\n\t\t\t\t\t32  {$tmp2 = \"Envelope C65\"}\r\n\t\t\t\t\t33  {$tmp2 = \"Envelope B4\"}\r\n\t\t\t\t\t34  {$tmp2 = \"Envelope B5\"}\r\n\t\t\t\t\t35  {$tmp2 = \"Envelope B6\"}\r\n\t\t\t\t\t36  {$tmp2 = \"Envelope Italy\"}\r\n\t\t\t\t\t37  {$tmp2 = \"Envelope Monarch\"}\r\n\t\t\t\t\t38  {$tmp2 = \"Envelope Personal\"}\r\n\t\t\t\t\t39  {$tmp2 = \"US Std Fanfold\"}\r\n\t\t\t\t\t40  {$tmp2 = \"German Std Fanfold\"}\r\n\t\t\t\t\t41  {$tmp2 = \"German Legal Fanfold\"}\r\n\t\t\t\t\t42  {$tmp2 = \"B4 (ISO)\"}\r\n\t\t\t\t\t43  {$tmp2 = \"Japanese Postcard\"}\r\n\t\t\t\t\t44  {$tmp2 = \"9X11\"}\r\n\t\t\t\t\t45  {$tmp2 = \"10X11\"}\r\n\t\t\t\t\t46  {$tmp2 = \"15X11\"}\r\n\t\t\t\t\t47  {$tmp2 = \"Envelope Invite\"}\r\n\t\t\t\t\t48  {$tmp2 = \"Reserved - DO NOT USE\"}\r\n\t\t\t\t\t49  {$tmp2 = \"Reserved - DO NOT USE\"}\r\n\t\t\t\t\t50  {$tmp2 = \"Letter Extra\"}\r\n\t\t\t\t\t51  {$tmp2 = \"Legal Extra\"}\r\n\t\t\t\t\t52  {$tmp2 = \"Tabloid Extra\"}\r\n\t\t\t\t\t53  {$tmp2 = \"A4 Extra\"}\r\n\t\t\t\t\t54  {$tmp2 = \"Letter Transverse\"}\r\n\t\t\t\t\t55  {$tmp2 = \"A4 Transverse\"}\r\n\t\t\t\t\t56  {$tmp2 = \"Letter Extra Transverse\"}\r\n\t\t\t\t\t57  {$tmp2 = \"A Plus\"}\r\n\t\t\t\t\t58  {$tmp2 = \"B Plus\"}\r\n\t\t\t\t\t59  {$tmp2 = \"Letter Plus\"}\r\n\t\t\t\t\t60  {$tmp2 = \"A4 Plus\"}\r\n\t\t\t\t\t61  {$tmp2 = \"A5 Transverse\"}\r\n\t\t\t\t\t62  {$tmp2 = \"B5 (JIS) Transverse\"}\r\n\t\t\t\t\t63  {$tmp2 = \"A3 Extra\"}\r\n\t\t\t\t\t64  {$tmp2 = \"A5 Extra\"}\r\n\t\t\t\t\t65  {$tmp2 = \"B5 (ISO) Extra\"}\r\n\t\t\t\t\t66  {$tmp2 = \"A2\"}\r\n\t\t\t\t\t67  {$tmp2 = \"A3 Transverse\"}\r\n\t\t\t\t\t68  {$tmp2 = \"A3 Extra Transverse\"}\r\n\t\t\t\t\t69  {$tmp2 = \"Japanese Double Postcard\"}\r\n\t\t\t\t\t70  {$tmp2 = \"A6\"}\r\n\t\t\t\t\t71  {$tmp2 = \"Japanese Envelope Kaku #2\"}\r\n\t\t\t\t\t72  {$tmp2 = \"Japanese Envelope Kaku #3\"}\r\n\t\t\t\t\t73  {$tmp2 = \"Japanese Envelope Chou #3\"}\r\n\t\t\t\t\t74  {$tmp2 = \"Japanese Envelope Chou #4\"}\r\n\t\t\t\t\t75  {$tmp2 = \"Letter Rotated\"}\r\n\t\t\t\t\t76  {$tmp2 = \"A3 Rotated\"}\r\n\t\t\t\t\t77  {$tmp2 = \"A4 Rotated\"}\r\n\t\t\t\t\t78  {$tmp2 = \"A5 Rotated\"}\r\n\t\t\t\t\t79  {$tmp2 = \"B4 (JIS) Rotated\"}\r\n\t\t\t\t\t80  {$tmp2 = \"B5 (JIS) Rotated\"}\r\n\t\t\t\t\t81  {$tmp2 = \"Japanese Postcard Rotated\"}\r\n\t\t\t\t\t82  {$tmp2 = \"Double Japanese Postcard Rotated\"}\r\n\t\t\t\t\t83  {$tmp2 = \"A6 Rotated\"}\r\n\t\t\t\t\t84  {$tmp2 = \"Japanese Envelope Kaku #2 Rotated\"}\r\n\t\t\t\t\t85  {$tmp2 = \"Japanese Envelope Kaku #3 Rotated\"}\r\n\t\t\t\t\t86  {$tmp2 = \"Japanese Envelope Chou #3 Rotated\"}\r\n\t\t\t\t\t87  {$tmp2 = \"Japanese Envelope Chou #4 Rotated\"}\r\n\t\t\t\t\t88  {$tmp2 = \"B6 (JIS)\"}\r\n\t\t\t\t\t89  {$tmp2 = \"B6 (JIS) Rotated\"}\r\n\t\t\t\t\t90  {$tmp2 = \"12X11\"}\r\n\t\t\t\t\t91  {$tmp2 = \"Japanese Envelope You #4\"}\r\n\t\t\t\t\t92  {$tmp2 = \"Japanese Envelope You #4 Rotated\"}\r\n\t\t\t\t\t93  {$tmp2 = \"PRC 16K\"}\r\n\t\t\t\t\t94  {$tmp2 = \"PRC 32K\"}\r\n\t\t\t\t\t95  {$tmp2 = \"PRC 32K(Big)\"}\r\n\t\t\t\t\t96  {$tmp2 = \"PRC Envelope #1\"}\r\n\t\t\t\t\t97  {$tmp2 = \"PRC Envelope #2\"}\r\n\t\t\t\t\t98  {$tmp2 = \"PRC Envelope #3\"}\r\n\t\t\t\t\t99  {$tmp2 = \"PRC Envelope #4\"}\r\n\t\t\t\t\t100 {$tmp2 = \"PRC Envelope #5\"}\r\n\t\t\t\t\t101 {$tmp2 = \"PRC Envelope #6\"}\r\n\t\t\t\t\t102 {$tmp2 = \"PRC Envelope #7\"}\r\n\t\t\t\t\t103 {$tmp2 = \"PRC Envelope #8\"}\r\n\t\t\t\t\t104 {$tmp2 = \"PRC Envelope #9\"}\r\n\t\t\t\t\t105 {$tmp2 = \"PRC Envelope #10\"}\r\n\t\t\t\t\t106 {$tmp2 = \"PRC 16K Rotated\"}\r\n\t\t\t\t\t107 {$tmp2 = \"PRC 32K Rotated\"}\r\n\t\t\t\t\t108 {$tmp2 = \"PRC 32K(Big) Rotated\"}\r\n\t\t\t\t\t109 {$tmp2 = \"PRC Envelope #1 Rotated\"}\r\n\t\t\t\t\t110 {$tmp2 = \"PRC Envelope #2 Rotated\"}\r\n\t\t\t\t\t111 {$tmp2 = \"PRC Envelope #3 Rotated\"}\r\n\t\t\t\t\t112 {$tmp2 = \"PRC Envelope #4 Rotated\"}\r\n\t\t\t\t\t113 {$tmp2 = \"PRC Envelope #5 Rotated\"}\r\n\t\t\t\t\t114 {$tmp2 = \"PRC Envelope #6 Rotated\"}\r\n\t\t\t\t\t115 {$tmp2 = \"PRC Envelope #7 Rotated\"}\r\n\t\t\t\t\t116 {$tmp2 = \"PRC Envelope #8 Rotated\"}\r\n\t\t\t\t\t117 {$tmp2 = \"PRC Envelope #9 Rotated\"}\r\n\t\t\t\t\tDefault {$tmp2 = \"Paper Size could not be determined: $($xelement)\"}\r\n\t\t\t\t}\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"form\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Form Name:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Form Name`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp2 = $xelement.SubString($index + 1)\r\n\t\t\t\tIf($tmp2.length -gt 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"true\"\r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"TrueType:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"TrueType`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp1 = $xelement.SubString($index + 1)\r\n\t\t\t\tSwitch ($tmp1)\r\n\t\t\t\t{\r\n\t\t\t\t\t1 {$tmp2 = \"Bitmap\"}\r\n\t\t\t\t\t2 {$tmp2 = \"Download\"}\r\n\t\t\t\t\t3 {$tmp2 = \"Substitute\"}\r\n\t\t\t\t\t4 {$tmp2 = \"Outline\"}\r\n\t\t\t\t\tDefault {$tmp2 = \"TrueType could not be determined: $($xelement)\"}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t}\r\n\t\t\"mode\" \r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Printer Model:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Printer Model`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp2 = $xelement.SubString($index + 1)\r\n\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t}\r\n\t\t}\r\n\t\t\"loca\" \r\n\t\t{\r\n\t\t\tIf($xtable)\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Location:\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$txt=\"Location`t:\"\r\n\t\t\t}\r\n\t\t\t$index = $xelement.SubString(0).IndexOf('=')\r\n\t\t\tif($index -ge 0)\r\n\t\t\t{\r\n\t\t\t\t$tmp2 = $xelement.SubString($index + 1)\r\n\t\t\t\tIf($tmp2.length -gt 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ReturnStr = \"$txt $tmp2\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tDefault {$ReturnStr = \"Session printer setting could not be determined: $($xelement)\"}\r\n\t}\r\n\tReturn $ReturnStr\r\n}\r\n\r\nFunction AbortScript\r\n{\r\n\t$Word.quit()\r\n\tWrite-Verbose \"$(Get-Date): System Cleanup\"\r\n\t[System.Runtime.Interopservices.Marshal]::ReleaseComObject($Word) | out-null\r\n\tRemove-Variable -Name word -Scope Global -EA 0\r\n\t[gc]::collect() \r\n\t[gc]::WaitForPendingFinalizers()\r\n\tWrite-Verbose \"$(Get-Date): Script has been aborted\"\r\n\tExit\r\n}\r\n\r\nFunction validStateProp( [object] $object, [string] $topLevel, [string] $secondLevel )\r\n{\r\n\t#function created 8-jan-2014 by Michael B. Smith\r\n\tif( $object )\r\n\t{\r\n\t\tIf( ( gm -Name $topLevel -InputObject $object ) )\r\n\t\t{\r\n\t\t\tIf( ( gm -Name $secondLevel -InputObject $object.$topLevel ) )\r\n\t\t\t{\r\n\t\t\t\tReturn $true\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tReturn $false\r\n}\r\n\r\nFunction ProcessCitrixPolicies\r\n{\r\n\tParam([string]$xDriveName)\r\n\r\n\tIf($xDriveName -eq \"\")\r\n\t{\r\n\t\tIf($Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\tWriteWordLine 0 0 \"IMA Policies\"\r\n\t\t\t$Policies = Get-CtxGroupPolicy -EA 0 | Sort-Object Type,PolicyName\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\t$Policies = Get-CtxGroupPolicy -EA 0 | Sort-Object Type,Priority\r\n\t\t}\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tIf($Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\tWriteWordLine 0 0 \"Active Directory Policies\"\r\n\t\t\t$Policies = Get-CtxGroupPolicy -DriveName $xDriveName -EA 0 | Sort-Object Type,PolicyName\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\t$Policies = Get-CtxGroupPolicy -DriveName $xDriveName -EA 0 | Sort-Object Type,Priority\r\n\t\t}\r\n\t}\r\n\r\n\tIf($?)\r\n\t{\r\n\t\tForEach($Policy in $Policies)\r\n\t\t{\r\n\t\t\tWrite-Verbose \"$(Get-Date): `tStarted $($Policy.PolicyName)`t$($Policy.Type)\"\r\n\t\t\tIf(!$Summary)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 2 0 $Policy.PolicyName\r\n\t\t\t\tIf($xDriveName -eq \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$Global:TotalIMAPolicies++\r\n\t\t\t\t\tWriteWordLine 0 1 \"IMA Farm based policy\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$Global:TotalADPolicies++\r\n\t\t\t\t\tWriteWordLine 0 1 \"Active Directory based policy\"\r\n\t\t\t\t}\r\n\r\n\t\t\t\tWriteWordLine 0 1 \"Type`t`t: \" $Policy.Type\r\n\r\n\t\t\t\tIf($Policy.Type -eq \"Computer\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$Global:TotalComputerPolicies++\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$Global:TotalUserPolicies++\r\n\t\t\t\t}\r\n\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($Policy.Description))\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Description`t: \" $Policy.Description\r\n\t\t\t\t}\r\n\t\t\t\tWriteWordLine 0 1 \"Enabled`t`t: \" $Policy.Enabled\r\n\t\t\t\tWriteWordLine 0 1 \"Priority`t`t: \" $Policy.Priority\r\n\r\n\t\t\t\tIf($xDriveName -eq \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$filters = Get-CtxGroupPolicyFilter -PolicyName $Policy.PolicyName -EA 0\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$filters = Get-CtxGroupPolicyFilter -PolicyName $Policy.PolicyName -DriveName $xDriveName -EA 0\r\n\t\t\t\t}\r\n\r\n\t\t\t\tIf($?)\r\n\t\t\t\t{\r\n\t\t\t\t\tIf(![String]::IsNullOrEmpty($filters))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Filter(s)`t`t:\"\r\n\t\t\t\t\t\tForEach($Filter in $Filters)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Filter name`t: \" $filter.FilterName\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Filter type`t: \" -nonewline\r\n\t\t\t\t\t\t\tSwitch($filter.FilterType)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\"User\"           {WriteWordLine 0 0 \"User or Group\"}\r\n\t\t\t\t\t\t\t\t\"WorkerGroup\"    {WriteWordLine 0 0 \"Worker Group\"}\r\n\t\t\t\t\t\t\t\t\"OU\"             {WriteWordLine 0 0 \"Organization Unit\"}\r\n\t\t\t\t\t\t\t\t\"ClientName\"     {WriteWordLine 0 0 \"Client Name\"}\r\n\t\t\t\t\t\t\t\t\"ClientIP\"       {WriteWordLine 0 0 \"Client IP Address\"}\r\n\t\t\t\t\t\t\t\t\"BranchRepeater\" {WriteWordLine 0 0 \"Branch Repeater\"}\r\n\t\t\t\t\t\t\t\t\"AccessControl\"  {WriteWordLine 0 0 \"Access Control\"}\r\n\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Policy Filter Type could not be determined: $($filter.FilterType)\"}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Filter enabled`t: \" $filter.Enabled\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Filter mode`t: \" $filter.Mode\r\n\t\t\t\t\t\t\tIf(![String]::IsNullOrEmpty($filter.FilterValue))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Filter value`t: \" $filter.FilterValue\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Filter(s)`t`t: None\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Unable to retrieve Filter settings\"\r\n\t\t\t\t}\r\n\t\t\t\tIf($xDriveName -eq \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$Settings = Get-CtxGroupPolicyConfiguration -PolicyName $Policy.PolicyName -EA 0\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$Settings = Get-CtxGroupPolicyConfiguration -PolicyName $Policy.PolicyName -DriveName $xDriveName -EA 0\r\n\t\t\t\t}\r\n\r\n\t\t\t\tIf($?)\r\n\t\t\t\t{\r\n\t\t\t\t\tForEach($Setting in $Settings)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tIf($Setting.Type -eq \"Computer\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tComputer settings\"\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\"\r\n\t\t\t\t\t\t\tWriteWordLine 0 1 \"Computer settings:\"\r\n\t\t\t\t\t\t\tIf($Setting.IcaListenerTimeout.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\ICA listener connection timeout (milliseconds): \" $Setting.IcaListenerTimeout.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.IcaListenerPortNumber.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\ICA listener port number: \" $Setting.IcaListenerPortNumber.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.AutoClientReconnect.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Auto Client Reconnect\\Auto client reconnect: \" $Setting.AutoClientReconnect.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.AutoClientReconnectLogging.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Auto Client Reconnect\\Auto client reconnect logging: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.AutoClientReconnectLogging.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"DoNotLogAutoReconnectEvents\" {WriteWordLine 0 3 \"Do Not Log auto-reconnect events\"}\r\n\t\t\t\t\t\t\t\t\t\"LogAutoReconnectEvents\"      {WriteWordLine 0 3 \"Log auto-reconnect events\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Auto client reconnect logging could not be determined: $($Setting.AutoClientReconnectLogging.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.IcaRoundTripCalculation.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\End User Monitoring\\ICA round trip calculation: \" $Setting.IcaRoundTripCalculation.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.IcaRoundTripCalculationInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\End User Monitoring\\ICA round trip calculation interval (seconds): \" $Setting.IcaRoundTripCalculationInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.IcaRoundTripCalculationWhenIdle.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\End User Monitoring\\ICA round trip calculations for idle connections: \" \r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 $Setting.IcaRoundTripCalculationWhenIdle.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DisplayMemoryLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Display memory limit (KB): \" $Setting.DisplayMemoryLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DisplayDegradePreference.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Display mode degrade preference: \"\r\n\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.DisplayDegradePreference.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"ColorDepth\" {WriteWordLine 0 3 \"Degrade color depth first\"}\r\n\t\t\t\t\t\t\t\t\t\"Resolution\" {WriteWordLine 0 3 \"Degrade resolution first\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Display mode degrade preference could not be determined: $($Setting.DisplayDegradePreference.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DynamicPreview.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Dynamic Windows Preview: \" $Setting.DynamicPreview.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ImageCaching.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Image caching: \" $Setting.ImageCaching.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MaximumColorDepth.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Maximum allowed color depth: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.MaximumColorDepth.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"BitsPerPixel8\"  {WriteWordLine 0 3 \"8 Bits Per Pixel\"}\r\n\t\t\t\t\t\t\t\t\t\"BitsPerPixel15\" {WriteWordLine 0 3 \"15 Bits Per Pixel\"}\r\n\t\t\t\t\t\t\t\t\t\"BitsPerPixel16\" {WriteWordLine 0 3 \"16 Bits Per Pixel\"}\r\n\t\t\t\t\t\t\t\t\t\"BitsPerPixel24\" {WriteWordLine 0 3 \"24 Bits Per Pixel\"}\r\n\t\t\t\t\t\t\t\t\t\"BitsPerPixel32\" {WriteWordLine 0 3 \"32 Bits Per Pixel\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Maximum allowed color depth could not be determined: $($Setting.MaximumColorDepth.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DisplayDegradeUserNotification.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Notify user when display mode is degraded: \" $Setting.DisplayDegradeUserNotification.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.QueueingAndTossing.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Queueing and tossing: \" $Setting.QueueingAndTossing.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PersistentCache.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Graphics\\Caching\\Persistent Cache Threshold (Kbps): \" $Setting.PersistentCache.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.IcaKeepAliveTimeout.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Keep Alive\\ICA keep alive timeout (seconds): \" $Setting.IcaKeepAliveTimeout.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.IcaKeepAlives.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Keep Alive\\ICA keep alives: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.IcaKeepAlives.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"DoNotSendKeepAlives\" {WriteWordLine 0 3 \"Do not send ICA keep alive messages\"}\r\n\t\t\t\t\t\t\t\t\t\"SendKeepAlives\"      {WriteWordLine 0 3 \"Send ICA keep alive messages\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"ICA keep alives could not be determined: $($Setting.IcaKeepAlives.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MultimediaConferencing.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Multimedia\\Multimedia conferencing: \" $Setting.MultimediaConferencing.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MultimediaAcceleration.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Multimedia\\Windows Media Redirection: \" $Setting.MultimediaAcceleration.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MultimediaAccelerationDefaultBufferSize.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Multimedia\\Windows Media Redirection Buffer Size (seconds): \" $Setting.MultimediaAccelerationDefaultBufferSize.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MultimediaAccelerationUseDefaultBufferSize.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Multimedia\\Windows Media Redirection Buffer Size Use: \" $Setting.MultimediaAccelerationUseDefaultBufferSize.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MultiPortPolicy.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\MultiStream Connections\\Multi-Port Policy: \" \r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"CGP default port\" -nonewline \r\n\t\t\t\t\t\t\t\tWriteWordLine 0 1 \"priority: High\"\r\n\t\t\t\t\t\t\t\t[string]$Tmp = $Setting.MultiPortPolicy.Value\r\n\t\t\t\t\t\t\t\tIf($Tmp.Length -gt 0)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t[string]$cgpport1 = $Tmp.substring(0, $Tmp.indexof(\";\"))\r\n\t\t\t\t\t\t\t\t\t[string]$cgpport2 = $Tmp.substring($cgpport1.length + 1 , $Tmp.indexof(\";\"))\r\n\t\t\t\t\t\t\t\t\t[string]$cgpport3 = $Tmp.substring((($cgpport1.length + 1)+($cgpport2.length + 1)) , $Tmp.indexof(\";\"))\r\n\t\t\t\t\t\t\t\t\t[string]$cgpport1priority = multiportpolicypriority $cgpport1.substring($cgpport1.length -1, 1)\r\n\t\t\t\t\t\t\t\t\t[string]$cgpport2priority = multiportpolicypriority $cgpport2.substring($cgpport2.length -1, 1)\r\n\t\t\t\t\t\t\t\t\t[string]$cgpport3priority = multiportpolicypriority $cgpport3.substring($cgpport3.length -1, 1)\r\n\t\t\t\t\t\t\t\t\t$cgpport1 = $cgpport1.substring(0, $cgpport1.indexof(\",\"))\r\n\t\t\t\t\t\t\t\t\t$cgpport2 = $cgpport2.substring(0, $cgpport2.indexof(\",\"))\r\n\t\t\t\t\t\t\t\t\t$cgpport3 = $cgpport3.substring(0, $cgpport3.indexof(\",\"))\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"CGP port1: \" $cgpport1 -nonewline \r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 1 \"priority: \" -nonewline\r\n\t\t\t\t\t\t\t\t\tSwitch ($cgpport1priority[0])\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\"V\"\t{WriteWordLine 0 0 \"Very High\"}\r\n\t\t\t\t\t\t\t\t\t\t\"M\"\t{WriteWordLine 0 0 \"Medium\"}\r\n\t\t\t\t\t\t\t\t\t\t\"L\"\t{WriteWordLine 0 0 \"Low\"}\r\n\t\t\t\t\t\t\t\t\t\tDefault\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"CGP port2: \" $cgpport2 -nonewline\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 1 \"priority: \" -nonewline\r\n\t\t\t\t\t\t\t\t\tSwitch ($cgpport2priority[0])\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\"V\"\t{WriteWordLine 0 0 \"Very High\"}\r\n\t\t\t\t\t\t\t\t\t\t\"M\"\t{WriteWordLine 0 0 \"Medium\"}\r\n\t\t\t\t\t\t\t\t\t\t\"L\"\t{WriteWordLine 0 0 \"Low\"}\r\n\t\t\t\t\t\t\t\t\t\tDefault\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"CGP port3: \" $cgpport3 -nonewline\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 1 \"priority: \" -nonewline\r\n\t\t\t\t\t\t\t\t\tSwitch ($cgpport3priority[0])\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\"V\"\t{WriteWordLine 0 0 \"Very High\"}\r\n\t\t\t\t\t\t\t\t\t\t\"M\"\t{WriteWordLine 0 0 \"Medium\"}\r\n\t\t\t\t\t\t\t\t\t\t\"L\"\t{WriteWordLine 0 0 \"Low\"}\r\n\t\t\t\t\t\t\t\t\t\tDefault\t{WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$cgpport1 = $Null\r\n\t\t\t\t\t\t\t\t\t$cgpport2 = $Null\r\n\t\t\t\t\t\t\t\t\t$cgpport3 = $Null\r\n\t\t\t\t\t\t\t\t\t$cgpport1priority = $Null\r\n\t\t\t\t\t\t\t\t\t$cgpport2priority = $Null\r\n\t\t\t\t\t\t\t\t\t$cgpport3priority = $Null\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$Tmp = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MultiStreamPolicy.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\MultiStream Connections\\Multi-Stream: \" $Setting.MultiStreamPolicy.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PromptForPassword.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Security\\Prompt for password: \" $Setting.PromptForPassword.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.IdleTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Server Limits\\Server idle timer interval (milliseconds): \" $Setting.IdleTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionReliabilityConnections.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Reliability\\Session reliability connections: \" $Setting.SessionReliabilityConnections.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionReliabilityPort.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Reliability\\Session reliability port number: \" $Setting.SessionReliabilityPort.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionReliabilityTimeout.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Reliability\\Session reliability timeout (seconds): \" $Setting.SessionReliabilityTimeout.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.Shadowing.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Shadowing\\Shadowing: \" $Setting.Shadowing.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tLicensing\"\r\n\t\t\t\t\t\t\tIf($Setting.LicenseServerHostName.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Licensing\\License server host name: \" $Setting.LicenseServerHostName.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LicenseServerPort.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Licensing\\License server port: \" $Setting.LicenseServerPort.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tPower and Capacity Management\"\r\n\t\t\t\t\t\t\tIf($Setting.FarmName.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Power and Capacity Management\\Farm name: \" $Setting.FarmName.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.WorkloadName.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Power and Capacity Management\\Workload name: \" $Setting.WorkloadName.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tServer Settings\"\r\n\t\t\t\t\t\t\tIf($Setting.ConnectionAccessControl.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Connection access control: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.ConnectionAccessControl.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"AllowAny\"                     {WriteWordLine 0 3 \"Any connections\"}\r\n\t\t\t\t\t\t\t\t\t\"AllowTicketedConnectionsOnly\" {WriteWordLine 0 3 \"Citrix Access Gateway, Citrix Receiver, and Web Interface connections only\"}\r\n\t\t\t\t\t\t\t\t\t\"AllowAccessGatewayOnly\"       {WriteWordLine 0 3 \"Citrix Access Gateway connections only\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Connection access control could not be determined: $($Setting.ConnectionAccessControl.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DnsAddressResolution.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\DNS address resolution: \" $Setting.DnsAddressResolution.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FullIconCaching.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Full icon caching: \" $Setting.FullIconCaching.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t#the next setting is only available for AD based policies\r\n\t\t\t\t\t\t\tIf($Setting.InitialZone.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Initial Zone Name: \" $Setting.InitialZone.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LoadEvaluator.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Load Evaluator Name - Load evaluator: \" $Setting.LoadEvaluator.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ProductEdition.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\XenApp product edition: \" $Setting.ProductEdition.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ProductModel.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\XenApp product model: \" -nonewline\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.ProductModel.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"XenAppCCU\"                  {WriteWordLine 0 0 \"XenApp\"}\r\n\t\t\t\t\t\t\t\t\t\"XenDesktopConcurrentServer\" {WriteWordLine 0 0 \"XenDesktop Concurrent\"}\r\n\t\t\t\t\t\t\t\t\t\"XenDesktopUserDevice\"       {WriteWordLine 0 0 \"XenDesktop User Device\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 0 \"XenApp product model could not be determined: $($Setting.ProductModel.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UserSessionLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Connection Limits\\Limit user sessions: \" $Setting.UserSessionLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UserSessionLimitAffectsAdministrators.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Connection Limits\\Limits on administrator sessions: \" $Setting.UserSessionLimitAffectsAdministrators.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UserSessionLimitLogging.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Connection Limits\\Logging of logon limit events: \" $Setting.UserSessionLimitLogging.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t#the next 3 settings are available only for AD based policies\r\n\t\t\t\t\t\t\tIf($Setting.InitialDatabaseName.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Database Settings\\Initial Database Name: \" $Setting.InitialDatabaseName.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.InitialDatabaseServerName.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Database Settings\\Initial Database Server Name: \" $Setting.InitialDatabaseServerName.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.InitialFailoverPartner.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Database Settings\\Initial Failover Partner: \" $Setting.InitialFailoverPartner.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t#the previous 3 settings are available only for AD based policies\r\n\t\t\t\t\t\t\tIf($Setting.HealthMonitoring.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Health Monitoring and Recovery\\Health monitoring: \" $Setting.HealthMonitoring.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.HealthMonitoringTests.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Health Monitoring and Recovery\\Health monitoring tests: \" \r\n\t\t\t\t\t\t\t\t[xml]$XML = $Setting.HealthMonitoringTests.Value\r\n\t\t\t\t\t\t\t\tForEach($Test in $xml.hmrtests.tests.test)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tCreate Table for HMR Test $($test.name)\"\r\n\t\t\t\t\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t\t\t\t\t\t[int]$Rows = $test.attributes.count - 1\r\n\t\t\t\t\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t\t\t\t\t$table.Borders.InsideLineStyle = 0\r\n\t\t\t\t\t\t\t\t\t$table.Borders.OutsideLineStyle = 0\r\n\t\t\t\t\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Name\"\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $test.name\r\n\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"File Location\"\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $test.file\r\n\t\t\t\t\t\t\t\t\tIf($test.HasAttribute(\"arguments\"))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Arguments\"\r\n\t\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $test.arguments\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tIf(![String]::IsNullOrEmpty($test.Description))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Description\"\r\n\t\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $test.description\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Interval\"\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $test.interval\r\n\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Time-out\"\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $test.timeout\r\n\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Threshold\"\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $test.threshold\r\n\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Recovery Action\"\r\n\t\t\t\t\t\t\t\t\tSwitch ($test.RecoveryAction)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\"AlertOnly\"                     {$Table.Cell($xRow,2).Range.Text = \"Alert Only\"}\r\n\t\t\t\t\t\t\t\t\t\t\"RemoveServerFromLoadBalancing\" {$Table.Cell($xRow,2).Range.Text = \"Remove Server from load balancing\"}\r\n\t\t\t\t\t\t\t\t\t\t\"RestartIma\"                    {$Table.Cell($xRow,2).Range.Text = \"Restart IMA\"}\r\n\t\t\t\t\t\t\t\t\t\t\"ShutdownIma\"                   {$Table.Cell($xRow,2).Range.Text = \"Shutdown IMA\"}\r\n\t\t\t\t\t\t\t\t\t\t\"RebootServer\"                  {$Table.Cell($xRow,2).Range.Text = \"Reboot Server\"}\r\n\t\t\t\t\t\t\t\t\t\tDefault {$Table.Cell($xRow,2).Range.Text = \"Recovery Action could not be determined: $($test.RecoveryAction)\"}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t$Table.Rows.SetLeftIndent(108,1)\r\n\t\t\t\t\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tReturn focus back to document\"\r\n\t\t\t\t\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tMove to the end of the current document\"\r\n\t\t\t\t\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$XML = $Null\r\n\t\t\t\t\t\t\t\t$xRow = $Null\r\n\t\t\t\t\t\t\t\t$Columns = $Null\r\n\t\t\t\t\t\t\t\t$Row = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MaximumServersOfflinePercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Health Monitoring and Recovery\\\"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"Max % of servers with logon control: \" $Setting.MaximumServersOfflinePercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.CpuManagementServerLevel.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Memory\/CPU\\CPU management server level: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.CpuManagementServerLevel.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"NoManagement\" {WriteWordLine 0 3 \"No CPU utilization management\"}\r\n\t\t\t\t\t\t\t\t\t\"Fair\"         {WriteWordLine 0 3 \"Fair sharing of CPU between sessions\"}\r\n\t\t\t\t\t\t\t\t\t\"Preferential\" {WriteWordLine 0 3 \"Preferential Load Balancing\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"CPU management server level could not be determined: $($Setting.CpuManagementServerLevel.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MemoryOptimization.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Memory\/CPU\\Memory optimization: \" $Setting.MemoryOptimization.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MemoryOptimizationExcludedPrograms.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Memory\/CPU\\Memory optimization application exclusion list: \"\r\n\t\t\t\t\t\t\t\t$array = $Setting.MemoryOptimizationExcludedPrograms.Values\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $element\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MemoryOptimizationIntervalType.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Memory\/CPU\\Memory optimization interval: \" -nonewline\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.MemoryOptimizationIntervalType.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"AtStartup\" {WriteWordLine 0 0 \"Only at startup time\"}\r\n\t\t\t\t\t\t\t\t\t\"Daily\"     {WriteWordLine 0 0 \"Daily\"}\r\n\t\t\t\t\t\t\t\t\t\"Weekly\"    {WriteWordLine 0 0 \"Weekly\"}\r\n\t\t\t\t\t\t\t\t\t\"Monthly\"   {WriteWordLine 0 0 \"Monthly\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 0 \" could not be determined: $($Setting.MemoryOptimizationIntervalType.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MemoryOptimizationDayOfMonth.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Memory\/CPU\\Memory optimization schedule: \"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"day of month: \" $Setting.MemoryOptimizationDayOfMonth.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MemoryOptimizationDayOfWeek.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Memory\/CPU\\Memory optimization schedule: \"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"day of week: \" $Setting.MemoryOptimizationDayOfWeek.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MemoryOptimizationTime.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Memory\/CPU\\Memory optimization schedule time: \" -nonewline\r\n\t\t\t\t\t\t\t\t$tmp = ConvertNumberToTime $Setting.MemoryOptimizationTime.Value\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 0 $tmp\r\n\t\t\t\t\t\t\t\t$tmp = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.OfflineClientTrust.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Offline Applications\\Offline app client trust: \" $Setting.OfflineClientTrust.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.OfflineEventLogging.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Offline Applications\\Offline app event logging: \" $Setting.OfflineEventLogging.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.OfflineLicensePeriod.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Offline Applications\\Offline app license period - Days: \" $Setting.OfflineLicensePeriod.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.OfflineUsers.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Offline Applications\\Offline app users: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.OfflineUsers.Values\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $element\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootCustomMessage.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot custom warning: \" $Setting.RebootCustomMessage.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootCustomMessageText.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot custom warning text: \" \r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 $Setting.RebootCustomMessageText.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootDisableLogOnTime.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot logon disable time: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.RebootDisableLogOnTime.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"DoNotDisableLogOnsBeforeReboot\" {WriteWordLine 0 3 \"Do not disable logons before reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Disable5MinutesBeforeReboot\"    {WriteWordLine 0 3 \"Disable 5 minutes before reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Disable10MinutesBeforeReboot\"   {WriteWordLine 0 3 \"Disable 10 minutes before reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Disable15MinutesBeforeReboot\"   {WriteWordLine 0 3 \"Disable 15 minutes before reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Disable30MinutesBeforeReboot\"   {WriteWordLine 0 3 \"Disable 30 minutes before reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Disable60MinutesBeforeReboot\"   {WriteWordLine 0 3 \"Disable 60 minutes before reboot\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Reboot logon disable time could not be determined: $($Setting.RebootDisableLogOnTime.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootScheduleFrequency.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot schedule frequency - Days: \" $Setting.RebootScheduleFrequency.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootScheduleRandomizationInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot schedule randomization interval\"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"Minutes: \" $Setting.RebootScheduleRandomizationInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootScheduleStartDate.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot schedule start date: \" -nonewline\r\n\t\t\t\t\t\t\t\t$Tmp = ConvertIntegerToDate $Setting.RebootScheduleStartDate.Value\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 0 $Tmp\r\n\t\t\t\t\t\t\t\t$Tmp = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootScheduleTime.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot schedule time: \" -nonewline\r\n\t\t\t\t\t\t\t\t$tmp = ConvertNumberToTime $Setting.RebootScheduleTime.Value \t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 0 $Tmp\r\n\t\t\t\t\t\t\t\t$Tmp = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootWarningInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot warning interval: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.RebootWarningInterval.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"Every1Minute\"   {WriteWordLine 0 3 \"Every 1 Minute\"}\r\n\t\t\t\t\t\t\t\t\t\"Every3Minutes\"  {WriteWordLine 0 3 \"Every 3 Minutes\"}\r\n\t\t\t\t\t\t\t\t\t\"Every5Minutes\"  {WriteWordLine 0 3 \"Every 5 Minutes\"}\r\n\t\t\t\t\t\t\t\t\t\"Every10Minutes\" {WriteWordLine 0 3 \"Every 10 Minutes\"}\r\n\t\t\t\t\t\t\t\t\t\"Every15Minutes\" {WriteWordLine 0 3 \"Every 15 Minutes\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Reboot warning interval could not be determined: $($Setting.RebootWarningInterval.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootWarningStartTime.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot warning start time: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.RebootWarningStartTime.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"Start5MinutesBeforeReboot\"  {WriteWordLine 0 3 \"Start 5 Minutes Before Reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Start10MinutesBeforeReboot\" {WriteWordLine 0 3 \"Start 10 Minutes Before Reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Start15MinutesBeforeReboot\" {WriteWordLine 0 3 \"Start 15 Minutes Before Reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Start30MinutesBeforeReboot\" {WriteWordLine 0 3 \"Start 30 Minutes Before Reboot\"}\r\n\t\t\t\t\t\t\t\t\t\"Start60MinutesBeforeReboot\" {WriteWordLine 0 3 \"Start 60 Minutes Before Reboot\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Reboot warning start time could not be determined: $($Setting.RebootWarningStartTime.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RebootWarningMessage.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Reboot warning to users: \" $Setting.RebootWarningMessage.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ScheduledReboots.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Settings\\Reboot Behavior\\Scheduled reboots: \" $Setting.ScheduledReboots.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tVirtual IP\"\r\n\t\t\t\t\t\t\tIf($Setting.FilterAdapterAddresses.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Virtual IP\\Virtual IP adapter address filtering: \" $Setting.FilterAdapterAddresses.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.EnhancedCompatibilityPrograms.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Virtual IP\\Virtual IP compatibility programs list: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.EnhancedCompatibilityPrograms.Values\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $element\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.EnhancedCompatibility.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Virtual IP\\Virtual IP enhanced compatibility: \" $Setting.EnhancedCompatibility.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FilterAdapterAddressesPrograms.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Virtual IP\\Virtual IP filter adapter addresses programs list: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.FilterAdapterAddressesPrograms.Values\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $element\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.VirtualLoopbackSupport.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Virtual IP\\Virtual IP loopback support: \" $Setting.VirtualLoopbackSupport.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.VirtualLoopbackPrograms.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Virtual IP\\Virtual IP virtual loopback programs list: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.VirtualLoopbackPrograms.Values\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $element\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tXML Service\"\r\n\t\t\t\t\t\t\tIf($Setting.TrustXmlRequests.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"XML Service\\Trust XML requests: \" $Setting.TrustXmlRequests.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.XmlServicePort.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"XML Service\\XML service port: \" $Setting.XmlServicePort.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tUser settings\"\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\"\r\n\t\t\t\t\t\t\tWriteWordLine 0 1 \"User settings:\"\r\n\t\t\t\t\t\t\tIf($Setting.ClipboardRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Client clipboard redirection: \" $Setting.ClipboardRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DesktopLaunchForNonAdmins.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Desktop launches: \" $Setting.DesktopLaunchForNonAdmins.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.NonPublishedProgramLaunching.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Launching of non-published programs during client connection: \" $Setting.NonPublishedProgramLaunching.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Adobe Flash Delivery\"\r\n\t\t\t\t\t\t\tIf($Setting.FlashAcceleration.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash acceleration: \" $Setting.FlashAcceleration.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashUrlColorList.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash background color list: \"\r\n\t\t\t\t\t\t\t\t$Values = $Setting.FlashUrlColorList.Values\r\n\t\t\t\t\t\t\t\tForEach($Value in $Values)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $Value\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$Values = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashBackwardsCompatibility.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash backwards compatibility: \" \r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 $Setting.FlashBackwardsCompatibility.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashDefaultBehavior.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash Default behavior: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.FlashDefaultBehavior.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"Block\"   {WriteWordLine 0 3 \"Block Flash player\"}\r\n\t\t\t\t\t\t\t\t\t\"Disable\" {WriteWordLine 0 3 \"Disable Flash acceleration\"}\r\n\t\t\t\t\t\t\t\t\t\"Enable\"  {WriteWordLine 0 3 \"Enable Flash acceleration\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Flash Default behavior could not be determined: $($Setting.FlashDefaultBehavior.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashEventLogging.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash event logging: \" $Setting.FlashEventLogging.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashIntelligentFallback.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash intelligent fallback: \" $Setting.FlashIntelligentFallback.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashLatencyThreshold.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash latency threshold\"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"Value (milliseconds): \" $Setting.FlashLatencyThreshold.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashServerSideContentFetchingWhitelist.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash server-side content fetching \"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"URL list: \"\r\n\t\t\t\t\t\t\t\t$Values = $Setting.FlashServerSideContentFetchingWhitelist.Values\r\n\t\t\t\t\t\t\t\tForEach($Value in $Values)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 4 $Value\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$Values = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FlashUrlCompatibilityList.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Flash Redirection\\Flash URL compatibility list: \" \r\n\t\t\t\t\t\t\t\t$Values = $Setting.FlashUrlCompatibilityList.Values\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tCreate table for Flash URL compatibility list\"\r\n\t\t\t\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t\t\t\t[int]$Columns = 3\r\n\t\t\t\t\t\t\t\t[int]$Rows = $Values.count + 1\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tAdd table to doc\"\r\n\t\t\t\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tFormat first row with column headings\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Action\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"URL Pattern\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Text = \"Flash Instance\"\r\n\t\t\t\t\t\t\t\tForEach($Value in $Values)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$Items = $Value.Split(' ')\r\n\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`t`tProcessing row for $($Value)\"\r\n\t\t\t\t\t\t\t\t\t$Action = $Items[0]\r\n\t\t\t\t\t\t\t\t\tIf($Action -eq \"CLIENT\")\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$Action = \"Render On Client\"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tElseIf($Action -eq \"SERVER\")\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$Action = \"Render On Server\"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tElseIf($Action -eq \"BLOCK\")\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$Action = \"BLOCK           \"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$Url = $Items[1]\r\n\t\t\t\t\t\t\t\t\tIf($Items.Count -eq 3)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$FlashInstance = $Items[2]\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$FlashInstance = \"\"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $Action\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $Url\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Text = $FlashInstance\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t$Table.Rows.SetLeftIndent(108,1)\r\n\t\t\t\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`t`tReturn focus back to document\"\r\n\t\t\t\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`t`tMove to the end of the current document\"\r\n\t\t\t\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\t\t\t\t$Values = $Null\r\n\t\t\t\t\t\t\t\t$Action = $Null\r\n\t\t\t\t\t\t\t\t$Url = $Null\r\n\t\t\t\t\t\t\t\t$FlashInstance = $Null\r\n\t\t\t\t\t\t\t\t$Spc = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.AllowSpeedFlash.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Adobe Flash Delivery\\Legacy Server Side Optimizations\\\"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"Flash quality adjustment: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.AllowSpeedFlash.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"NoOptimization\"      {WriteWordLine 0 3 \"Do not optimize Flash animation options\"}\r\n\t\t\t\t\t\t\t\t\t\"AllConnections\"      {WriteWordLine 0 3 \"Optimize Flash animation options for all connections\"}\r\n\t\t\t\t\t\t\t\t\t\"RestrictedBandwidth\" {WriteWordLine 0 3 \"Optimize Flash animation options for low bandwidth connections only\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Flash quality adjustment could not be determined: $($Setting.AllowSpeedFlash.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Audio\"\r\n\t\t\t\t\t\t\tIf($Setting.AudioPlugNPlay.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Audio\\Audio Plug N Play: \" $Setting.AudioPlugNPlay.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.AudioQuality.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Audio\\Audio quality: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.AudioQuality.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"Low\"    {WriteWordLine 0 3 \"Low - for low-speed connections\"}\r\n\t\t\t\t\t\t\t\t\t\"Medium\" {WriteWordLine 0 3 \"Medium - optimized for speech\"}\r\n\t\t\t\t\t\t\t\t\t\"High\"   {WriteWordLine 0 3 \"High - high definition audio\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Audio quality could not be determined: $($Setting.AudioQuality.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientAudioRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Audio\\Client audio redirection: \" $Setting.ClientAudioRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MicrophoneRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Audio\\Client microphone redirection: \" $Setting.MicrophoneRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Bandwidth\"\r\n\t\t\t\t\t\t\tIf($Setting.AudioBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Audio redirection bandwidth limit (Kbps): \" $Setting.AudioBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.AudioBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Audio redirection bandwidth limit %: \" $Setting.AudioBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.USBBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Client USB device redirection bandwidth limit: \" $Setting.USBBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.USBBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Client USB device redirection bandwidth limit %: \" $Setting.USBBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClipboardBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Clipboard redirection bandwidth limit (Kbps): \" $Setting.ClipboardBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClipboardBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Clipboard redirection bandwidth limit %: \" $Setting.ClipboardBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ComPortBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\COM port redirection bandwidth limit (Kbps): \" $Setting.ComPortBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ComPortBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\COM port redirection bandwidth limit %: \" $Setting.ComPortBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FileRedirectionBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\File redirection bandwidth limit (Kbps): \" $Setting.FileRedirectionBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.FileRedirectionBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\File redirection bandwidth limit %: \" $Setting.FileRedirectionBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.HDXMultimediaBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\HDX MediaStream Multimedia Acceleration \"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"bandwidth limit (Kbps): \" $Setting.HDXMultimediaBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.HDXMultimediaBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\HDX MediaStream Multimedia Acceleration \"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"bandwidth limit %: \" $Setting.HDXMultimediaBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LptBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\LPT port redirection bandwidth limit (Kbps): \" $Setting.LptBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LptBandwidthLimitPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\LPT port redirection bandwidth limit %: \" $Setting.LptBandwidthLimitPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.OverallBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Overall session bandwidth limit (Kbps): \" $Setting.OverallBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PrinterBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Printer redirection bandwidth limit (Kbps): \" $Setting.PrinterBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PrinterBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\Printer redirection bandwidth limit %: \" $Setting.PrinterBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.TwainBandwidthLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\TWAIN device redirection bandwidth limit (Kbps): \" $Setting.TwainBandwidthLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.TwainBandwidthPercent.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Bandwidth\\TWAIN device redirection bandwidth limit %: \" $Setting.TwainBandwidthPercent.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Desktop UI\"\r\n\t\t\t\t\t\t\tIf($Setting.DesktopWallpaper.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Desktop UI\\Desktop wallpaper: \" $Setting.DesktopWallpaper.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.MenuAnimation.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Desktop UI\\Menu animation: \" $Setting.MenuAnimation.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.WindowContentsVisibleWhileDragging.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Desktop UI\\View window contents while dragging: \" $Setting.WindowContentsVisibleWhileDragging.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\File Redirection\"\r\n\t\t\t\t\t\t\tIf($Setting.AutoConnectDrives.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Auto connect client drives: \" $Setting.AutoConnectDrives.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientDriveRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Client drive redirection: \" $Setting.ClientDriveRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientFixedDrives.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Client fixed drives: \" $Setting.ClientFixedDrives.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientFloppyDrives.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Client floppy drives: \" $Setting.ClientFloppyDrives.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientNetworkDrives.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Client network drives: \" $Setting.ClientNetworkDrives.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientOpticalDrives.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Client optical drives: \" $Setting.ClientOpticalDrives.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientRemoveableDrives.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Client removable drives: \" $Setting.ClientRemoveableDrives.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.HostToClientRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Host to client redirection: \" $Setting.HostToClientRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ReadOnlyMappedDrive.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Read-only client drive access: \" $Setting.ReadOnlyMappedDrive.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SpecialFolderRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Special folder redirection: \" $Setting.SpecialFolderRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.AsynchronousWrites.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\File Redirection\\Use asynchronous writes: \" $Setting.AsynchronousWrites.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t# added for the XenApp 6.5 Mobility Pack\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Mobile Experience\"\r\n\t\t\t\t\t\t\t#If($Setting.AutoKeyboardPopUp.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\tif( ( validStateProp $Setting AutoKeyboardPopUp State ) -and ( $Setting.AutoKeyboardPopUp.State -ne \"NotConfigured\" ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Mobile Experience\\Automatic keyboard display: \" $Setting.AutoKeyboardPopUp.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t#If($Setting.MobileDesktop.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\tif( ( validStateProp $Setting MobileDesktop State ) -and ( $Setting.MobileDesktop.State -ne \"NotConfigured\" ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Mobile Experience\\Launch touch-optimized desktop: \" $Setting.MobileDesktop.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t#If($Setting.ComboboxRemoting.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\tif( ( validStateProp $Setting ComboboxRemoting State ) -and ( $Setting.ComboboxRemoting.State -ne \"NotConfigured\" ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Mobile Experience\\Remote the combo box: \" $Setting.ComboboxRemoting.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Multi-Stream Connections\"\r\n\t\t\t\t\t\t\tIf($Setting.MultiStream.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Multi-Stream Connections\\Multi-Stream: \" $Setting.MultiStream.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Port Redirection\"\r\n\t\t\t\t\t\t\tIf($Setting.ClientComPortsAutoConnection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Port Redirection\\Auto connect client COM ports: \" $Setting.ClientComPortsAutoConnection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientLptPortsAutoConnection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Port Redirection\\Auto connect client LPT ports: \" $Setting.ClientLptPortsAutoConnection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientComPortRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Port Redirection\\Client COM port redirection: \" $Setting.ClientComPortRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientLptPortRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Port Redirection\\Client LPT port redirection: \" $Setting.ClientLptPortRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Printing\"\r\n\t\t\t\t\t\t\tIf($Setting.ClientPrinterRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client printer redirection: \" $Setting.ClientPrinterRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DefaultClientPrinter.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Default printer - Choose client's Default printer: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.DefaultClientPrinter.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"ClientDefault\" {WriteWordLine 0 3 \"Set Default printer to the client's main printer\"}\r\n\t\t\t\t\t\t\t\t\t\"DoNotAdjust\"   {WriteWordLine 0 3 \"Do not adjust the user's Default printer\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 0 \"Default printer could not be determined: $($Setting.DefaultClientPrinter.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.AutoCreationEventLogPreference.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Printer auto-creation event log preference: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.AutoCreationEventLogPreference.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"LogErrorsOnly\"        {WriteWordLine 0 3 \"Log errors only\"}\r\n\t\t\t\t\t\t\t\t\t\"LogErrorsAndWarnings\" {WriteWordLine 0 3 \"Log errors and warnings\"}\r\n\t\t\t\t\t\t\t\t\t\"DoNotLog\"             {WriteWordLine 0 3 \"Do not log errors or warnings\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Printer auto-creation event log preference could not be determined: $($Setting.AutoCreationEventLogPreference.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionPrinters.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Session printers:\" \r\n\t\t\t\t\t\t\t\t$valArray = $Setting.SessionPrinters.Values\r\n\t\t\t\t\t\t\t\tForEach($printer in $valArray)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$prArray = $printer.Split(',')\r\n\t\t\t\t\t\t\t\t\tForEach($element in $prArray)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($element.SubString(0, 2) -eq \"\\\\\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$index = $element.SubString(2).IndexOf('\\')\r\n\t\t\t\t\t\t\t\t\t\t\tif($index -ge 0)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$server = $element.SubString(0, $index + 2)\r\n\t\t\t\t\t\t\t\t\t\t\t\t$share  = $element.SubString($index + 3)\r\n\t\t\t\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"Server`t`t: $server\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"Shared Name`t: $share\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t$index = $Null\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$tmp = $element.SubString(0, 4)\r\n\t\t\t\t\t\t\t\t\t\t\t$PrtString = Get-PrinterModifiedSettings $tmp $element $False\r\n\t\t\t\t\t\t\t\t\t\t\tIf(![String]::IsNullOrEmpty($PrtString))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $PrtString\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t$tmp = $Null\r\n\t\t\t\t\t\t\t\t\t\t\t$PrtString = $Null\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$valArray = $Null\r\n\t\t\t\t\t\t\t\t$prArray = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.WaitForPrintersToBeCreated.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Wait for printers to be created (desktop): \" $Setting.WaitForPrintersToBeCreated.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientPrinterAutoCreation.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client Printers\\Auto-create client printers: \"\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.ClientPrinterAutoCreation.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"DoNotAutoCreate\"    {WriteWordLine 0 3 \"Do not auto-create client printers\"}\r\n\t\t\t\t\t\t\t\t\t\"DefaultPrinterOnly\" {WriteWordLine 0 3 \"Auto-create the client's Default printer only\"}\r\n\t\t\t\t\t\t\t\t\t\"LocalPrintersOnly\"  {WriteWordLine 0 3 \"Auto-create local (non-network) client printers only\"}\r\n\t\t\t\t\t\t\t\t\t\"AllPrinters\"        {WriteWordLine 0 3 \"Auto-create all client printers\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Auto-create client printers could not be determined: $($Setting.ClientPrinterAutoCreation.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.GenericUniversalPrinterAutoCreation.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client Printers\\Auto-create generic universal printer: \" $Setting.GenericUniversalPrinterAutoCreation.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ClientPrinterNames.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client Printers\\Client printer names: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.ClientPrinterNames.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"StandardPrinterNames\" {WriteWordLine 0 3 \"Standard printer names\"}\r\n\t\t\t\t\t\t\t\t\t\"LegacyPrinterNames\"   {WriteWordLine 0 3 \"Legacy printer names\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Client printer names could not be determined: $($Setting.ClientPrinterNames.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DirectConnectionsToPrintServers.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client Printers\\Direct connections to print servers: \" $Setting.DirectConnectionsToPrintServers.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PrinterDriverMappings.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client Printers\\Printer driver mapping and compatibility: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.PrinterDriverMappings.Values\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tCreate table for printer drive mapping\"\r\n\t\t\t\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t\t\t\t[int]$Columns = 4\r\n\t\t\t\t\t\t\t\t[int]$Rows = $array.count + 1\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tAdd table to doc\"\r\n\t\t\t\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tFormat first row with column headings\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Driver Name\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Action\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Text = \"Settings\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,4).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,4).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,4).Range.Text = \"Server Driver\"\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t#WriteWordLine 0 3 $element\r\n\t\t\t\t\t\t\t\t\t$Items = $element.Split(',')\r\n\t\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`t`tProcessing row for $($Items[0])\"\r\n\t\t\t\t\t\t\t\t\t$DriverName = $Items[0]\r\n\t\t\t\t\t\t\t\t\t$Action = $Items[1]\r\n\t\t\t\t\t\t\t\t\tIf($Action -match 'Replace=')\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$ServerDriver = $Action.substring($Action.indexof(\"=\")+1)\r\n\t\t\t\t\t\t\t\t\t\t$Action = \"Replace\"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$ServerDriver = \"\"\r\n\t\t\t\t\t\t\t\t\t\tIf($Action -eq \"Allow\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$Action = \"Allow\"\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tElseIf($Action -eq \"Deny\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$Action = \"Do not create\"\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tElseIf($Action -eq \"UPD_Only\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$Action = \"Create with universal driver\"\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tIf($Items.count -gt 2)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$PrtSettings = \"\"\r\n\t\t\t\t\t\t\t\t\t\t[int]$BeginAt = 2\r\n\t\t\t\t\t\t\t\t\t\t[int]$EndAt = $Items.count\r\n\t\t\t\t\t\t\t\t\t\tfor ($i=$BeginAt;$i -lt $EndAt; $i++) \r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$tmp = $Items[$i].SubString(0, 4)\r\n\t\t\t\t\t\t\t\t\t\t\t$tmp1 = Get-PrinterModifiedSettings $tmp $Items[$i] $True\r\n\t\t\t\t\t\t\t\t\t\t\tIf(![String]::IsNullOrEmpty($tmp1))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$PrtSettings += ($tmp1 + \"`n\")\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$PrtSettings = \"Unmodified\"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $DriverName\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $Action\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Text = $PrtSettings\r\n\t\t\t\t\t\t\t\t\t$Table.Cell($xRow,4).Range.Text = $ServerDriver\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t\t$Table.Rows.SetLeftIndent(108,1)\r\n\t\t\t\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tReturn focus back to document\"\r\n\t\t\t\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tMove to the end of the current document\"\r\n\t\t\t\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PrinterPropertiesRetention.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client Printers\\Printer properties retention: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.PrinterPropertiesRetention.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"SavedOnClientDevice\"   {WriteWordLine 0 3 \"Saved on the client device only\"}\r\n\t\t\t\t\t\t\t\t\t\"RetainedInUserProfile\" {WriteWordLine 0 3 \"Retained in user profile only\"}\r\n\t\t\t\t\t\t\t\t\t\"FallbackToProfile\"     {WriteWordLine 0 3 \"Held in profile only if not saved on client\"}\r\n\t\t\t\t\t\t\t\t\t\"DoNotRetain\"           {WriteWordLine 0 3 \"Do not retain printer properties\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Printer properties retention could not be determined: $($Setting.PrinterPropertiesRetention.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.RetainedAndRestoredClientPrinters.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Client Printers\\Retained and restored client printers: \" $Setting.RetainedAndRestoredClientPrinters.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.InboxDriverAutoInstallation.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Drivers\\Automatic installation of in-box printer drivers: \" $Setting.InboxDriverAutoInstallation.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UniversalDriverPriority.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Drivers\\Universal driver preference: \" \r\n\t\t\t\t\t\t\t\t$TmpArray = $Setting.UniversalDriverPriority.Value.Split(';')\r\n\t\t\t\t\t\t\t\tForEach($Thing in $TmpArray)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $Thing\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$TmpArray = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UniversalPrintDriverUsage.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Drivers\\Universal print driver usage: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.UniversalPrintDriverUsage.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"SpecificOnly\"       {WriteWordLine 0 3 \"Use only printer model specific drivers\"}\r\n\t\t\t\t\t\t\t\t\t\"UpdOnly\"            {WriteWordLine 0 3 \"Use universal printing only\"}\r\n\t\t\t\t\t\t\t\t\t\"FallbackToUpd\"      {WriteWordLine 0 3 \"Use universal printing only if requested driver is unavailable\"}\r\n\t\t\t\t\t\t\t\t\t\"FallbackToSpecific\" {WriteWordLine 0 3 \"Use printer model specific drivers only if universal printing is unavailable\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Universal print driver usage could not be determined: $($Setting.UniversalPrintDriverUsage.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.EMFProcessingMode.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Universal Printing\\Universal printing EMF processing mode: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.EMFProcessingMode.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"ReprocessEMFsForPrinter\" {WriteWordLine 0 3 \"Reprocess EMFs for printer\"}\r\n\t\t\t\t\t\t\t\t\t\"SpoolDirectlyToPrinter\"  {WriteWordLine 0 3 \"Spool directly to printer\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Universal printing EMF processing mode could not be determined: $($Setting.EMFProcessingMode.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ImageCompressionLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Universal Printing\\Universal printing image compression limit: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.ImageCompressionLimit.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"NoCompression\"       {WriteWordLine 0 3 \"No compression\"}\r\n\t\t\t\t\t\t\t\t\t\"LosslessCompression\" {WriteWordLine 0 3 \"Best quality (lossless compression)\"}\r\n\t\t\t\t\t\t\t\t\t\"MinimumCompression\"  {WriteWordLine 0 3 \"High quality\"}\r\n\t\t\t\t\t\t\t\t\t\"MediumCompression\"   {WriteWordLine 0 3 \"Standard quality\"}\r\n\t\t\t\t\t\t\t\t\t\"MaximumCompression\"  {WriteWordLine 0 3 \"Reduced quality (maximum compression)\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Universal printing image compression limit could not be determined: $($Setting.ImageCompressionLimit.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UPDCompressionDefaults.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Universal Printing\\Universal printing optimization defaults: \"\r\n\t\t\t\t\t\t\t\t$TmpArray = $Setting.UPDCompressionDefaults.Value.Split(';')\r\n\t\t\t\t\t\t\t\tForEach($Thing in $TmpArray)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$TestLabel = $Thing.substring(0, $Thing.indexof(\"=\"))\r\n\t\t\t\t\t\t\t\t\t$TestSetting = $Thing.substring($Thing.indexof(\"=\")+1)\r\n\t\t\t\t\t\t\t\t\t$TxtLabel = \"\"\r\n\t\t\t\t\t\t\t\t\t$TxtSetting = \"ABC\"\r\n\t\t\t\t\t\t\t\t\tSwitch($TestLabel)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\"ImageCompression\"\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$TxtLabel = \"Desired image quality:\"\r\n\t\t\t\t\t\t\t\t\t\t\tSwitch($TestSetting)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"StandardQuality\"\t{$TxtSetting = \"Standard quality\"}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"BestQuality\"\t{$TxtSetting = \"Best quality (lossless compression)\"}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"HighQuality\"\t{$TxtSetting = \"High quality\"}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"ReducedQuality\"\t{$TxtSetting = \"Reduced quality (maximum compression)\"}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\"HeavyweightCompression\"\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$TxtLabel = \"Enable heavyweight compression:\"\r\n\t\t\t\t\t\t\t\t\t\t\tIf($TestSetting -eq \"True\")\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"Yes\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"No\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\"ImageCaching\"\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$TxtLabel = \"Allow caching of embedded images:\"\r\n\t\t\t\t\t\t\t\t\t\t\tIf($TestSetting -eq \"True\")\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"Yes\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"No\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\"FontCaching\"\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$TxtLabel = \"Allow caching of embedded fonts:\"\r\n\t\t\t\t\t\t\t\t\t\t\tIf($TestSetting -eq \"True\")\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"Yes\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"No\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\"AllowNonAdminsToModify\"\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$TxtLabel = \"Allow non-administrators to modify these settings:\"\r\n\t\t\t\t\t\t\t\t\t\t\tIf($TestSetting -eq \"True\")\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"Yes\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$TxtSetting = \"No\"\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"$TxtLabel $TxtSetting\"\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$TmpArray = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UniversalPrintingPreviewPreference.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Universal Printing\\Universal printing preview preference: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.UniversalPrintingPreviewPreference.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"NoPrintPreview\"        {WriteWordLine 0 3 \"Do not use print preview for auto-created or generic universal printers\"}\r\n\t\t\t\t\t\t\t\t\t\"AutoCreatedOnly\"       {WriteWordLine 0 3 \"Use print preview for auto-created printers only\"}\r\n\t\t\t\t\t\t\t\t\t\"GenericOnly\"           {WriteWordLine 0 3 \"Use print preview for generic universal printers only\"}\r\n\t\t\t\t\t\t\t\t\t\"AutoCreatedAndGeneric\" {WriteWordLine 0 3 \"Use print preview for both auto-created and generic universal printers\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Universal printing preview preference could not be determined: $($Setting.UniversalPrintingPreviewPreference.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.DPILimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Printing\\Universal Printing\\Universal printing print quality limit: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.DPILimit.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"Draft\"            {WriteWordLine 0 3 \"Draft (150 DPI)\"}\r\n\t\t\t\t\t\t\t\t\t\"LowResolution\"    {WriteWordLine 0 3 \"Low Resolution (300 DPI)\"}\r\n\t\t\t\t\t\t\t\t\t\"MediumResolution\" {WriteWordLine 0 3 \"Medium Resolution (600 DPI)\"}\r\n\t\t\t\t\t\t\t\t\t\"HighResolution\"   {WriteWordLine 0 3 \"High Resolution (1200 DPI)\"}\r\n\t\t\t\t\t\t\t\t\t\"Unlimited \"       {WriteWordLine 0 3 \"No Limit\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Universal printing print quality limit could not be determined: $($Setting.DPILimit.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Security\"\r\n\t\t\t\t\t\t\tIf($Setting.MinimumEncryptionLevel.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Security\\SecureICA minimum encryption level: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.MinimumEncryptionLevel.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"Unknown\" {WriteWordLine 0 3 \"Unknown encryption\"}\r\n\t\t\t\t\t\t\t\t\t\"Basic\"   {WriteWordLine 0 3 \"Basic\"}\r\n\t\t\t\t\t\t\t\t\t\"LogOn\"   {WriteWordLine 0 3 \"RC5 (128 bit) logon only\"}\r\n\t\t\t\t\t\t\t\t\t\"Bits40\"  {WriteWordLine 0 3 \"RC5 (40 bit)\"}\r\n\t\t\t\t\t\t\t\t\t\"Bits56\"  {WriteWordLine 0 3 \"RC5 (56 bit)\"}\r\n\t\t\t\t\t\t\t\t\t\"Bits128\" {WriteWordLine 0 3 \"RC5 (128 bit)\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"SecureICA minimum encryption level could not be determined: $($Setting.MinimumEncryptionLevel.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Session limits\"\r\n\t\t\t\t\t\t\tIf($Setting.ConcurrentLogOnLimit.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session limits\\Concurrent logon limit: \" $Setting.ConcurrentLogOnLimit.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionDisconnectTimer.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Disconnected session timer: \" $Setting.SessionDisconnectTimer.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionDisconnectTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Disconnected session timer interval (minutes): \" $Setting.SessionDisconnectTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LingerDisconnectTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Linger Disconnect Timer Interval (minutes): \" $Setting.LingerDisconnectTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LingerTerminateTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Linger Terminate Timer Interval - Value (minutes): \" $Setting.LingerTerminateTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PrelaunchDisconnectTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Pre-launch Disconnect Timer Interval - Value (minutes): \" $Setting.PrelaunchDisconnectTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.PrelaunchTerminateTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Pre-launch Terminate Timer Interval - Value (minutes): \" $Setting.PrelaunchTerminateTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionConnectionTimer.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Session connection timer: \" $Setting.SessionConnectionTimer.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionConnectionTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Session connection timer interval - Value (minutes): \" $Setting.SessionConnectionTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionIdleTimer.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Session idle timer: \" $Setting.SessionIdleTimer.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionIdleTimerInterval.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Session Limits\\Session idle timer interval - Value (minutes): \" $Setting.SessionIdleTimerInterval.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Shadowing\"\r\n\t\t\t\t\t\t\tIf($Setting.ShadowInput.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Shadowing\\Input from shadow connections: \" $Setting.ShadowInput.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ShadowLogging.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Shadowing\\Log shadow attempts: \" $Setting.ShadowLogging.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ShadowUserNotification.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Shadowing\\Notify user of pending shadow connections: \" $Setting.ShadowUserNotification.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ShadowAllowList.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Shadowing\\Users who can shadow other users: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.ShadowAllowList.Values\r\n\t\t\t\t\t\t\t\t#gui only shows computer\\account or domain\\account\r\n\t\t\t\t\t\t\t\t#what is stored is:\r\n\t\t\t\t\t\t\t\t#0x05\/NT\/XA65\\ANON000\/S-1-5-21-1307341077-4083623718-4268213518-1028 (workgroup\/local)\r\n\t\t\t\t\t\t\t\t#0x05\/NT\/XA651\\CTX_CPUUSER\/S-1-5-21-1200344839-3835835227-1016768578-1002 (domain\/local)\r\n\t\t\t\t\t\t\t\t#0x05\/NT\/WEBSTERSLAB\\ADMINISTRATOR\/S-1-5-21-3679396586-1061193519-2853834051-500 (domain user)\r\n\t\t\t\t\t\t\t\t#0x05\/NT\/WEBSTERSLAB\\DOMAIN ADMINS\/S-1-5-21-3679396586-1061193519-2853834051-512 (domain group)\r\n\t\t\t\t\t\t\t\t#we only need the computer\\account or domain\\account\r\n\t\t\t\t\t\t\t\t#first 9 characters are 0x05\/NT\/ for all account types\r\n\t\t\t\t\t\t\t\t#since PoSH starts counting at 0 we don't need the first 9 characters\r\n\t\t\t\t\t\t\t\t#Then we need the position of the first \/ after the computer\\account\r\n\t\t\t\t\t\t\t\t#what is left between the two is what we need\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$x = $element.indexof(\"\/\",8)\r\n\t\t\t\t\t\t\t\t\t$tmp = $element.substring(8,$x-8)\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $tmp\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t\t$x = $Null\r\n\t\t\t\t\t\t\t\t$tmp = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ShadowDenyList.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Shadowing\\Users who cannot shadow other users: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.ShadowDenyList.Values\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$x = $element.indexof(\"\/\",8)\r\n\t\t\t\t\t\t\t\t\t$tmp = $element.substring(8,$x-8)\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $tmp\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t\t$x = $Null\r\n\t\t\t\t\t\t\t\t$tmp = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Time Zone Control\"\r\n\t\t\t\t\t\t\tIf($Setting.LocalTimeEstimation.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Time Zone Control\\Estimate local time for legacy clients: \" $Setting.LocalTimeEstimation.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SessionTimeZone.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Time Zone Control\\Use local time of client: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.SessionTimeZone.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"UseServerTimeZone\" {WriteWordLine 0 3 \"Use server time zone\"}\r\n\t\t\t\t\t\t\t\t\t\"UseClientTimeZone\" {WriteWordLine 0 3 \"Use client time zone\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Use local time of client could not be determined: $($Setting.SessionTimeZone.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\TWAIN devices\"\r\n\t\t\t\t\t\t\tIf($Setting.TwainRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\TWAIN devices\\Client TWAIN device redirection: \" $Setting.TwainRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.TwainCompressionLevel.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\TWAIN devices\\TWAIN compression level: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.TwainCompressionLevel.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"None\"   {WriteWordLine 0 3 \"None\"}\r\n\t\t\t\t\t\t\t\t\t\"Low\"    {WriteWordLine 0 3 \"Low\"}\r\n\t\t\t\t\t\t\t\t\t\"Medium\" {WriteWordLine 0 3 \"Medium\"}\r\n\t\t\t\t\t\t\t\t\t\"High\"   {WriteWordLine 0 3 \"High\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"TWAIN compression level could not be determined: $($Setting.TwainCompressionLevel.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\USB devices\"\r\n\t\t\t\t\t\t\tIf($Setting.UsbDeviceRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\USB devices\\Client USB device redirection: \" $Setting.UsbDeviceRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UsbDeviceRedirectionRules.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\USB devices\\Client USB device redirection rules: \" \r\n\t\t\t\t\t\t\t\t$array = $Setting.UsbDeviceRedirectionRules.Values\r\n\t\t\t\t\t\t\t\tForEach($element in $array)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tWriteWordLine 0 3 $element\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$array = $Null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.UsbPlugAndPlayRedirection.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\USB devices\\Client USB Plug and Play device redirection: \" $Setting.UsbPlugAndPlayRedirection.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tICA\\Visual Display\"\r\n\t\t\t\t\t\t\tIf($Setting.FramesPerSecond.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Max Frames Per Second (fps): \" $Setting.FramesPerSecond.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ProgressiveCompressionLevel.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Moving Images\\Progressive compression level: \" -nonewline\r\n\t\t\t\t\t\t\t\tSwitch ($Setting.ProgressiveCompressionLevel.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"UltraHigh\" {WriteWordLine 0 0 \"Ultra high\"}\r\n\t\t\t\t\t\t\t\t\t\"VeryHigh\"  {WriteWordLine 0 0 \"Very high\"}\r\n\t\t\t\t\t\t\t\t\t\"High\"      {WriteWordLine 0 0 \"High\"}\r\n\t\t\t\t\t\t\t\t\t\"Normal\"    {WriteWordLine 0 0 \"Normal\"}\r\n\t\t\t\t\t\t\t\t\t\"Low\"       {WriteWordLine 0 0 \"Low\"}\r\n\t\t\t\t\t\t\t\t\t\"None\"      {WriteWordLine 0 0 \"None\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 0 \"Progressive compression level could not be determined: $($Setting.ProgressiveCompressionLevel.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ProgressiveCompressionThreshold.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Moving Images\\Progressive compression \"\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 \"threshold value (Kbps): \" $Setting.ProgressiveCompressionThreshold.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ExtraColorCompression.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Still Images\\Extra Color Compression: \" $Setting.ExtraColorCompression.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ExtraColorCompressionThreshold.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Still Images\\Extra Color Compression Threshold (Kbps): \" $Setting.ExtraColorCompressionThreshold.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.ProgressiveHeavyweightCompression.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Still Images\\Heavyweight compression: \" $Setting.ProgressiveHeavyweightCompression.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LossyCompressionLevel.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Still Images\\Lossy compression level: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.LossyCompressionLevel.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"None\"   {WriteWordLine 0 3 \"None\"}\r\n\t\t\t\t\t\t\t\t\t\"Low\"    {WriteWordLine 0 3 \"Low\"}\r\n\t\t\t\t\t\t\t\t\t\"Medium\" {WriteWordLine 0 3 \"Medium\"}\r\n\t\t\t\t\t\t\t\t\t\"High\"   {WriteWordLine 0 3 \"High\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Lossy compression level could not be determined: $($Setting.LossyCompressionLevel.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.LossyCompressionThreshold.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"ICA\\Visual Display\\Still Images\\Lossy compression threshold value (Kbps): \" \r\n\t\t\t\t\t\t\t\tWriteWordLine 0 3 $Setting.LossyCompressionThreshold.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tServer Session Settings\"\r\n\t\t\t\t\t\t\tIf($Setting.SessionImportance.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Session Settings\\Session importance: \" \r\n\t\t\t\t\t\t\t\tSwitch ($Setting.SessionImportance.Value)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\"Low\"    {WriteWordLine 0 3 \"Low\"}\r\n\t\t\t\t\t\t\t\t\t\"Normal\" {WriteWordLine 0 3 \"Normal\"}\r\n\t\t\t\t\t\t\t\t\t\"High\"   {WriteWordLine 0 3 \"High\"}\r\n\t\t\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Session importance could not be determined: $($Setting.SessionImportance.Value)\"}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SingleSignOn.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Session Settings\\Single Sign-On: \" $Setting.SingleSignOn.State\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tIf($Setting.SingleSignOnCentralStore.State -ne \"NotConfigured\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tWriteWordLine 0 2 \"Server Session Settings\\Single Sign-On central store: \" $Setting.SingleSignOnCentralStore.Value\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Unable to retrieve settings\"\r\n\t\t\t\t}\r\n\t\t\t\t$Filter = $Null\r\n\t\t\t\t$Settings = $Null\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFinished $($Policy.PolicyName)`t$($Policy.Type)\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"$($Policy.Type) Policy - $($Policy.PolicyName)\"\r\n\t\t\t\tIf($xDriveName -eq \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$Global:TotalIMAPolicies++\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$Global:TotalADPolicies++\r\n\t\t\t\t}\r\n\t\t\t\t$Global:TotalPolicies++\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tElse \r\n\t{\r\n\t\tWrite-Warning \"Citrix Policy information could not be retrieved.\"\r\n\t}\r\n\r\n\t$Policies = $Null\r\n\tIf($xDriveName -ne \"\")\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): `tRemoving ADGpoDrv PSDrive\"\r\n\t\tRemove-PSDrive ADGpoDrv -EA 0\r\n\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t}\r\n}\r\n\r\nFunction GetCtxGPOsInAD\r\n{\r\n\t#thanks to the Citrix Engineering Team for pointers and for Michael B. Smith for creating the function\r\n\t#updated 07-Nov-13 to work in a Windows Workgroup environment\r\n\tWrite-Verbose \"$(Get-Date): Testing for an Active Directory environment\"\r\n\t$root = [ADSI]\"LDAP:\/\/RootDSE\"\r\n\tIf([String]::IsNullOrEmpty($root.PSBase.Name))\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Not in an Active Directory environment\"\r\n\t\t$root = $null\r\n\t\t$xArray = @()\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): In an Active Directory environment\"\r\n\t\t$domainNC = $root.defaultNamingContext.ToString()\r\n\t\t$root = $null\r\n\t\t$xArray = @()\r\n\r\n\t\t$domain = $domainNC.Replace( 'DC=', '' ).Replace( ',', '.' )\r\n\t\tWrite-Verbose \"$(Get-Date): Searching \\\\$($domain)\\sysvol\\$($domain)\\Policies\"\r\n\t\t$sysvolFiles = @()\r\n\t\t$sysvolFiles = dir -Recurse ( '\\\\' + $domain  + '\\sysvol\\' + $domain + '\\Policies' ) -EA 0\r\n\t\tIf($sysvolFiles.Count -eq 0)\r\n\t\t{\r\n\t\t\tWrite-Verbose \"$(Get-Date): Search timed out.  Retrying.  Searching \\\\ + $($domain)\\sysvol\\$($domain)\\Policies a second time.\"\r\n\t\t\t$sysvolFiles = dir -Recurse ( '\\\\' + $domain  + '\\sysvol\\' + $domain + '\\Policies' ) -EA 0\r\n\t\t}\r\n\t\tforeach( $file in $sysvolFiles )\r\n\t\t{\r\n\t\t\tIf( -not $file.PSIsContainer )\r\n\t\t\t{\r\n\t\t\t\t#$file.FullName  ### name of the policy file\r\n\t\t\t\tIf( $file.FullName -like \"*\\Citrix\\GroupPolicy\\Policies.gpf\" )\r\n\t\t\t\t{\r\n\t\t\t\t\t#\"have match \" + $file.FullName ### name of the Citrix policies file\r\n\t\t\t\t\t$array = $file.FullName.Split( '\\' )\r\n\t\t\t\t\tIf( $array.Length -gt 7 )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$gp = $array[ 6 ].ToString()\r\n\t\t\t\t\t\t$gpObject = [ADSI]( \"LDAP:\/\/\" + \"CN=\" + $gp + \",CN=Policies,CN=System,\" + $domainNC )\r\n\t\t\t\t\t\t$xArray += $gpObject.DisplayName\t### name of the group policy object\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tReturn ,$xArray\r\n}\r\n\r\nFunction BuildTableForServerOrWG\r\n{\r\n\tParam([Array]$xArray)\r\n\r\n\tIf(-not ($xArray -is [Array]))\r\n\t{\r\n\t\t$xArray = (,$xArray)\r\n\t}\r\n\t[int]$MaxLength = 0\r\n\t[int]$TmpLength = 0\r\n\tForEach($xName in $xArray)\r\n\t{\r\n\t\t$TmpLength = $xName.Length\r\n\t\tIf($TmpLength -gt $MaxLength)\r\n\t\t{\r\n\t\t\t$MaxLength = $TmpLength\r\n\t\t}\r\n\t}\r\n\tWrite-Verbose \"$(Get-Date): `t`tMax length of server name is $($MaxLength)\"\r\n\t$TableRange = $doc.Application.Selection.Range\r\n\t[int]$Columns = [Math]::Floor(60 \/ $MaxLength)\r\n\tIf($xArray.count -lt $Columns)\r\n\t{\r\n\t\t[int]$Rows = 1\r\n\t\t#not enough array items to fill columns so use array count\r\n\t\t$MaxCells = $xArray.Count\r\n\t\t#reset column count so there are no empty columns\r\n\t\t$Columns = $xArray.Count \r\n\t}\r\n\tElse\r\n\t{\r\n\t\t[int]$Rows = [Math]::Floor( ( $xArray.count + $Columns - 1 ) \/ $Columns)\r\n\t\t#more array items than columns so don't go past last column\r\n\t\t$MaxCells = $Columns\r\n\t}\r\n\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t$table.Style = $myHash.Word_TableGrid\r\n\t$table.Borders.InsideLineStyle = 1\r\n\t$table.Borders.OutsideLineStyle = 1\r\n\t[int]$xRow = 1\r\n\t[int]$ArrayItem = 0\r\n\tWhile($xRow -le $Rows)\r\n\t{\r\n\t\tFor($xCell=1; $xCell -le $MaxCells; $xCell++)\r\n\t\t{\r\n\t\t\t$Table.Cell($xRow,$xCell).Range.Text = $xArray[$ArrayItem]\r\n\t\t\t$ArrayItem++\r\n\t\t}\r\n\t\t$xRow++\r\n\t}\r\n\tWrite-Verbose \"$(Get-Date): `t`tMove table to the right\"\r\n\t$Table.Rows.SetLeftIndent(36,1)\r\n\t$table.AutoFitBehavior(1)\r\n\r\n\t#return focus back to document\r\n\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t#move to the end of the current document\r\n\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t$xArray = $Null\r\n}\r\n\r\n#Script begins\r\n\r\n$script:startTime = Get-Date\r\n\r\nIf(!(Check-NeededPSSnapins \"Citrix.Common.Commands\",\"Citrix.XenApp.Commands\"))\r\n{\r\n    #We're missing Citrix Snapins that we need\r\n    Write-Error \"Missing Citrix PowerShell Snap-ins Detected, check the console above for more information. Are you sure you are running this script on a XenApp 6.5 Server? Script will now close.\"\r\n    Exit\r\n}\r\n\r\nCheckWordPreReq\r\n\r\n#if software inventory is specified then verify SoftwareExclusions.txt exists\r\nIf($Software)\r\n{\r\n\tIf(!(Test-Path \"$($pwd.path)\\SoftwareExclusions.txt\"))\r\n\t{\r\n\t\tWrite-Error \"Software inventory requested but $($pwd.path)\\SoftwareExclusions.txt does not exist.  Script cannot continue.\"\r\n\t\tExit\r\n\t}\r\n\r\n\t#file does exist but can we access it?\r\n\t$x = Get-Content \"$($pwd.path)\\SoftwareExclusions.txt\" -EA 0\r\n\tIf(!($?))\r\n\t{\r\n\t\tWrite-Error \"There was an error accessing or reading $($pwd.path)\\SoftwareExclusions.txt.  Script cannot continue.\"\r\n\t\tExit\r\n\t}\r\n\t$x = $Null\r\n}\r\n\r\n[bool]$Remoting = $False\r\n$RemoteXAServer = Get-XADefaultComputerName -EA 0\r\nIf(![String]::IsNullOrEmpty($RemoteXAServer))\r\n{\r\n\t$Remoting = $True\r\n}\r\n\r\nIf($Remoting)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Remoting is enabled to XenApp server $RemoteXAServer\"\r\n\t#now need to make sure the script is not being run against a session-only host\r\n\t$Server = Get-XAServer -ServerName $RemoteXAServer -EA 0\r\n\tIf($Server.ElectionPreference -eq \"WorkerMode\")\r\n\t{\r\n\t\tWrite-Warning \"This script cannot be run remotely against a Session-only Host Server.\"\r\n\t\tWrite-Warning \"Use Set-XADefaultComputerName XA65ControllerServerName or run the script on a controller.\"\r\n\t\tWrite-Error \"Script cannot continue.  See messages above.\"\r\n\t\tExit\r\n\t}\r\n}\r\nElse\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Remoting is not being used\"\r\n\r\n\t#now need to make sure the script is not being run on a session-only host\r\n\t$ServerName = (Get-Childitem env:computername).value\r\n\t$Server = Get-XAServer -ServerName $ServerName -EA 0\r\n\tIf($Server.ElectionPreference -eq \"WorkerMode\")\r\n\t{\r\n\t\tWrite-Warning \"This script cannot be run on a Session-only Host Server if Remoting is not enabled.\"\r\n\t\tWrite-Warning \"Use Set-XADefaultComputerName XA65ControllerServerName or run the script on a controller.\"\r\n\t\tWrite-Error \"Script cannot continue.  See messages above.\"\r\n\t\tExit\r\n\t}\r\n}\r\n\r\n# Get farm information\r\nWrite-Verbose \"$(Get-Date): Getting Farm data\"\r\n$farm = Get-XAFarm -EA 0\r\n\r\nIf($?)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Verify farm version\"\r\n\t#first check to make sure this is a XenApp 6.5 farm\r\n\tIf($Farm.ServerVersion.ToString().SubString(0,3) -eq \"6.5\")\r\n\t{\r\n\t\t#this is a XenApp 6.5 farm, script can proceed\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t#this is not a XenApp 6.5 farm, script cannot proceed\r\n\t\tWrite-Warning \"This script is designed for XenApp 6.5 and should not be run on previous versions of XenApp\"\r\n\t\tReturn 1\r\n\t}\r\n\t[string]$FarmName = $farm.FarmName\r\n\t[string]$Title = \"Inventory Report for the $($FarmName) Farm\"\r\n\tIf($Summary)\r\n\t{\r\n\t\t[string]$filename1 = \"$($pwd.path)\\$($farm.FarmName)_Summary.docx\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t[string]$filename1 = \"$($pwd.path)\\$($farm.FarmName).docx\"\r\n\t}\r\n\tIf($PDF)\r\n\t{\r\n\t\tIf($Summary)\r\n\t\t{\r\n\t\t\t[string]$filename2 = \"$($pwd.path)\\$($farm.FarmName)_Summary.pdf\"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\t[string]$filename2 = \"$($pwd.path)\\$($farm.FarmName).pdf\"\r\n\t\t}\r\n\t}\r\n} \r\nElse \r\n{\r\n\tWrite-Warning \"Farm information could not be retrieved\"\r\n\tIf($Remoting)\r\n\t{\r\n\t\tWrite-Error \"A remote connection to $RemoteXAServer could not be established.  Script cannot continue.\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tWrite-Error \"Farm information could not be retrieved.  Script cannot continue.\"\r\n\t}\r\n\tExit\r\n}\r\n$farm = $Null\r\n\r\nWrite-Verbose \"$(Get-Date): Setting up Word\"\r\n\r\n# Setup word for output\r\nWrite-Verbose \"$(Get-Date): Create Word comObject.  If you are not running Word 2007, ignore the next message.\"\r\n$Word = New-Object -comobject \"Word.Application\" -EA 0\r\n\r\nIf(!$? -or $Word -eq $Null)\r\n{\r\n\tWrite-Warning \"The Word object could not be created.  You may need to repair your Word installation.\"\r\n\tWrite-Error \"The Word object could not be created.  You may need to repair your Word installation.  Script cannot continue.\"\r\n\tExit\r\n}\r\n\r\n[int]$WordVersion = [int]$Word.Version\r\nIf($WordVersion -eq $wdWord2013)\r\n{\r\n\t$WordProduct = \"Word 2013\"\r\n}\r\nElseIf($WordVersion -eq $wdWord2010)\r\n{\r\n\t$WordProduct = \"Word 2010\"\r\n}\r\nElseIf($WordVersion -eq $wdWord2007)\r\n{\r\n\t$WordProduct = \"Word 2007\"\r\n}\r\nElse\r\n{\r\n\tWrite-Error \"You are running an untested or unsupported version of Microsoft Word.  Script will end.  Please send info on your version of Word to webster@carlwebster.com\"\r\n\tAbortScript\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Running Microsoft $WordProduct\"\r\n\r\nIf($PDF -and $WordVersion -eq $wdWord2007)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Verify the Word 2007 Save As PDF add-in is installed\"\r\n\tIf(CheckWord2007SaveAsPDFInstalled)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): The Word 2007 Save As PDF add-in is installed\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tAbortScript\r\n\t}\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Validate company name\"\r\n#only validate CompanyName if the field is blank\r\nIf([String]::IsNullOrEmpty($CompanyName))\r\n{\r\n\t$CompanyName = ValidateCompanyName\r\n\tIf([String]::IsNullOrEmpty($CompanyName))\r\n\t{\r\n\t\tWrite-Warning \"Company Name cannot be blank.\"\r\n\t\tWrite-Warning \"Check HKCU:\\Software\\Microsoft\\Office\\Common\\UserInfo for Company or CompanyName value.\"\r\n\t\tWrite-Error \"Script cannot continue.  See messages above.\"\r\n\t\tAbortScript\r\n\t}\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Check Default Cover Page for language specific version\"\r\n[bool]$CPChanged = $False\r\nSwitch ($PSCulture.Substring(0,3))\r\n{\r\n\t'ca-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"L\u00c3\u00adnia lateral\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'da-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"Sidelinje\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'de-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"Randlinie\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'es-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"L\u00c3\u00adnea lateral\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'fi-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"Sivussa\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'fr-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\tIf($WordVersion -eq $wdWord2013)\r\n\t\t\t\t{\r\n\t\t\t\t\t$CoverPage = \"Lignes lat\u00c3\u00a9rales\"\r\n\t\t\t\t\t$CPChanged = $True\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$CoverPage = \"Ligne lat\u00c3\u00a9rale\"\r\n\t\t\t\t\t$CPChanged = $True\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'nb-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"Sidelinje\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'nl-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"Terzijde\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'pt-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"Linha Lateral\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t'sv-'\t{\r\n\t\t\tIf($CoverPage -eq \"Sideline\")\r\n\t\t\t{\r\n\t\t\t\t$CoverPage = \"Sidlinje\"\r\n\t\t\t\t$CPChanged = $True\r\n\t\t\t}\r\n\t\t}\r\n}\r\n\r\nIf($CPChanged)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Changed Default Cover Page from Sideline to $($CoverPage)\"\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Validate cover page\"\r\n[bool]$ValidCP = ValidateCoverPage $WordVersion $CoverPage\r\nIf(!$ValidCP)\r\n{\r\n\tWrite-Error \"For $WordProduct, $CoverPage is not a valid Cover Page option.  Script cannot continue.\"\r\n\tAbortScript\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): \"\r\nWrite-Verbose \"$(Get-Date): \"\r\nWrite-Verbose \"$(Get-Date): Company Name : $CompanyName\"\r\nWrite-Verbose \"$(Get-Date): Cover Page   : $CoverPage\"\r\nWrite-Verbose \"$(Get-Date): User Name    : $UserName\"\r\nWrite-Verbose \"$(Get-Date): Save As PDF  : $PDF\"\r\nWrite-Verbose \"$(Get-Date): HW Inventory : $Hardware\"\r\nWrite-Verbose \"$(Get-Date): SW Inventory : $Software\"\r\nIf(!$Summary)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Start Date   : $StartDate\"\r\n\tWrite-Verbose \"$(Get-Date): End Date     : $EndDate\"\r\n}\r\nWrite-Verbose \"$(Get-Date): Summary      : $Summary\"\r\nWrite-Verbose \"$(Get-Date): Farm Name    : $FarmName\"\r\nWrite-Verbose \"$(Get-Date): Title        : $Title\"\r\nWrite-Verbose \"$(Get-Date): Filename1    : $filename1\"\r\nIf($PDF)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Filename2    : $filename2\"\r\n}\r\nWrite-Verbose \"$(Get-Date): OS Detected  : $RunningOS\"\r\nWrite-Verbose \"$(Get-Date): PSUICulture  : $PSUICulture\"\r\nWrite-Verbose \"$(Get-Date): PSCulture    : $PSCulture\"\r\nWrite-Verbose \"$(Get-Date): Word version : $WordProduct\"\r\nWrite-Verbose \"$(Get-Date): Word language: $($Word.Language)\"\r\nWrite-Verbose \"$(Get-Date): PoSH version : $($Host.Version)\"\r\nWrite-Verbose \"$(Get-Date): \"\r\nWrite-Verbose \"$(Get-Date): Script start : $($Script:StartTime)\"\r\nWrite-Verbose \"$(Get-Date): \"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\n$Word.Visible = $False\r\n\r\n#http:\/\/jdhitsolutions.com\/blog\/2012\/05\/san-diego-2012-powershell-deep-dive-slides-and-demos\/\r\n#using Jeff's Demo-WordReport.ps1 file for examples\r\n#down to $configlog = $False is from Jeff Hicks\r\nWrite-Verbose \"$(Get-Date): Load Word Templates\"\r\n\r\n[bool]$CoverPagesExist = $False\r\n[bool]$BuildingBlocksExist = $False\r\n\r\n$word.Templates.LoadBuildingBlocks()\r\nIf($WordVersion -eq $wdWord2007)\r\n{\r\n\t$BuildingBlocks = $word.Templates | Where {$_.name -eq \"Building Blocks.dotx\"}\r\n}\r\nElse\r\n{\r\n\t$BuildingBlocks = $word.Templates | Where {$_.name -eq \"Built-In Building Blocks.dotx\"}\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Attempt to load cover page $($CoverPage)\"\r\n$part = $Null\r\n\r\nIf($BuildingBlocks -ne $Null)\r\n{\r\n\t$BuildingBlocksExist = $True\r\n\r\n\tTry \r\n\t\t{$part = $BuildingBlocks.BuildingBlockEntries.Item($CoverPage)}\r\n\r\n\tCatch\r\n\t\t{$part = $Null}\r\n\r\n\tIf($part -ne $Null)\r\n\t{\r\n\t\t$CoverPagesExist = $True\r\n\t}\r\n}\r\n\r\nIf(!$CoverPagesExist)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Cover Pages are not installed or the Cover Page $($CoverPage) does not exist.\"\r\n\tWrite-Warning \"Cover Pages are not installed or the Cover Page $($CoverPage) does not exist.\"\r\n\tWrite-Warning \"This report will not have a Cover Page.\"\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Create empty word doc\"\r\n$Doc = $Word.Documents.Add()\r\nIf($Doc -eq $Null)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): \"\r\n\tWrite-Error \"An empty Word document could not be created.  Script cannot continue.\"\r\n\tAbortScript\r\n}\r\n\r\n$Selection = $Word.Selection\r\nIf($Selection -eq $Null)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): \"\r\n\tWrite-Error \"An unknown error happened selecting the entire Word document for default formatting options.  Script cannot continue.\"\r\n\tAbortScript\r\n}\r\n\r\n#set Default tab stops to 1\/2 inch (this line is not from Jeff Hicks)\r\n#36 = .50\"\r\n$Word.ActiveDocument.DefaultTabStop = 36\r\n\r\n#Disable Spell and Grammar Check to resolve issue and improve performance (from Pat Coughlin)\r\nWrite-Verbose \"$(Get-Date): Disable grammar and spell checking\"\r\n$Word.Options.CheckGrammarAsYouType = $False\r\n$Word.Options.CheckSpellingAsYouType = $False\r\n\r\nIf($CoverPagesExist)\r\n{\r\n\t#insert new page, getting ready for table of contents\r\n\tWrite-Verbose \"$(Get-Date): Insert new page, getting ready for table of contents\"\r\n\t$part.Insert($selection.Range,$True) | out-null\r\n\t$selection.InsertNewPage()\r\n\r\n\t#table of contents\r\n\tWrite-Verbose \"$(Get-Date): Table of Contents - $($myHash.Word_TableOfContents)\"\r\n\t$toc = $BuildingBlocks.BuildingBlockEntries.Item($myHash.Word_TableOfContents)\r\n\tIf($toc -eq $Null)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t\tWrite-Verbose \"$(Get-Date): Table of Content - $($myHash.Word_TableOfContents) could not be retrieved.\"\r\n\t\tWrite-Warning \"This report will not have a Table of Contents.\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t$toc.insert($selection.Range,$True) | out-null\r\n\t}\r\n}\r\nElse\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Table of Contents are not installed.\"\r\n\tWrite-Warning \"Table of Contents are not installed so this report will not have a Table of Contents.\"\r\n}\r\n\r\n#set the footer\r\nWrite-Verbose \"$(Get-Date): Set the footer\"\r\n[string]$footertext = \"Report created by $username\"\r\n\r\n#get the footer\r\nWrite-Verbose \"$(Get-Date): Get the footer and format font\"\r\n$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekPrimaryFooter\r\n#get the footer and format font\r\n$footers = $doc.Sections.Last.Footers\r\nForEach($footer in $footers) \r\n{\r\n\tIf($footer.exists) \r\n\t{\r\n\t\t$footer.range.Font.name = \"Calibri\"\r\n\t\t$footer.range.Font.size = 8\r\n\t\t$footer.range.Font.Italic = $True\r\n\t\t$footer.range.Font.Bold = $True\r\n\t}\r\n} #end ForEach\r\nWrite-Verbose \"$(Get-Date): Footer text\"\r\n$selection.HeaderFooter.Range.Text = $footerText\r\n\r\n#add page numbering\r\nWrite-Verbose \"$(Get-Date): Add page numbering\"\r\n$selection.HeaderFooter.PageNumbers.Add($wdAlignPageNumberRight) | Out-Null\r\n\r\n#return focus to main document\r\nWrite-Verbose \"$(Get-Date): Return focus to main document\"\r\n$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n#move to the end of the current document\r\nWrite-Verbose \"$(Get-Date): Move to the end of the current document\"\r\nWrite-Verbose \"$(Get-Date):\"\r\n$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n#end of Jeff Hicks \r\n\r\nIf(!$Summary)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Processing Configuration Logging\"\r\n\t[bool]$ConfigLog = $False\r\n\t$ConfigurationLogging = Get-XAConfigurationLog -EA 0\r\n\r\n\tIf($?)\r\n\t{\r\n\t\t$selection.InsertNewPage()\r\n\t\tWriteWordLine 1 0 \"Configuration Logging\"\r\n\t\tIf($ConfigurationLogging.LoggingEnabled) \r\n\t\t{\r\n\t\t\t$ConfigLog = $True\r\n\t\t\tWriteWordLine 0 1 \"Configuration Logging is enabled.\"\r\n\t\t\tWriteWordLine 0 1 \"Allow changes to the farm when logging database is disconnected: \" $ConfigurationLogging.ChangesWhileDisconnectedAllowed\r\n\t\t\tWriteWordLine 0 1 \"Require administrator to enter credentials before clearing the log: \" $ConfigurationLogging.CredentialsOnClearLogRequired\r\n\t\t\tWriteWordLine 0 1 \"Database type: \" $ConfigurationLogging.DatabaseType\r\n\t\t\tWriteWordLine 0 1 \"Authentication mode: \" $ConfigurationLogging.AuthenticationMode\r\n\t\t\tWriteWordLine 0 1 \"Connection string: \" \r\n\t\t\t$Tmp = \"`t`t\" + $ConfigurationLogging.ConnectionString.replace(\";\",\"`n`t`t`t\")\r\n\t\t\tWriteWordLine 0 1 $Tmp -NoNewline\r\n\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\tWriteWordLine 0 1 \"User name: \" $ConfigurationLogging.UserName\r\n\t\t\t$Tmp = $Null\r\n\t\t}\r\n\t\tElse \r\n\t\t{\r\n\t\t\tWriteWordLine 0 1 \"Configuration Logging is disabled.\"\r\n\t\t}\r\n\t}\r\n\tElse \r\n\t{\r\n\t\tWrite-Warning  \"Configuration Logging could not be retrieved\"\r\n\t}\r\n\t$ConfigurationLogging = $Null\r\n\tWrite-Verbose \"$(Get-Date): Finished Configuration Logging\"\r\n\tWrite-Verbose \"$(Get-Date): \"\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Processing Administrators\"\r\nWrite-Verbose \"$(Get-Date): `tSetting summary variables\"\r\n[int]$TotalFullAdmins = 0\r\n[int]$TotalViewAdmins = 0\r\n[int]$TotalCustomAdmins = 0\r\n[int]$TotalAdmins = 0\r\n\r\nWrite-Verbose \"$(Get-Date): `tRetrieving Administrators\"\r\n$Administrators = Get-XAAdministrator -EA 0 | Sort-Object AdministratorName\r\n\r\nIf($?)\r\n{\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Administrators:\"\r\n\tForEach($Administrator in $Administrators)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing administrator $($Administrator.AdministratorName)\"\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 2 0 $Administrator.AdministratorName\r\n\t\t\tWriteWordLine 0 1 \"Administrator type: \" -nonewline\r\n\t\t\tSwitch ($Administrator.AdministratorType)\r\n\t\t\t{\r\n\t\t\t\t\"Unknown\"  {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\"Full\"     {WriteWordLine 0 0 \"Full Administration\"; $TotalFullAdmins++}\r\n\t\t\t\t\"ViewOnly\" {WriteWordLine 0 0 \"View Only\"; $TotalViewAdmins++}\r\n\t\t\t\t\"Custom\"   {WriteWordLine 0 0 \"Custom\"; $TotalCustomAdmins++}\r\n\t\t\t\tDefault    {WriteWordLine 0 0 \"Administrator type could not be determined: $($Administrator.AdministratorType)\"}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 1 \"Administrator account is \" -NoNewLine\r\n\t\t\tIf($Administrator.Enabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Enabled\" \r\n\t\t\t} \r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Disabled\" \r\n\t\t\t}\r\n\t\t\tIf($Administrator.AdministratorType -eq \"Custom\") \r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Farm Privileges:\"\r\n\t\t\t\tForEach($farmprivilege in $Administrator.FarmPrivileges) \r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing farm privilege $farmprivilege\"\r\n\t\t\t\t\tSwitch ($farmprivilege)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Unknown\"                   {WriteWordLine 0 2 \"Unknown\"}\r\n\t\t\t\t\t\t\"ViewFarm\"                  {WriteWordLine 0 2 \"View farm management\"}\r\n\t\t\t\t\t\t\"EditZone\"                  {WriteWordLine 0 2 \"Edit zones\"}\r\n\t\t\t\t\t\t\"EditConfigurationLog\"      {WriteWordLine 0 2 \"Configure logging for the farm\"}\r\n\t\t\t\t\t\t\"EditFarmOther\"             {WriteWordLine 0 2 \"Edit all other farm settings\"}\r\n\t\t\t\t\t\t\"ViewAdmins\"                {WriteWordLine 0 2 \"View Citrix administrators\"}\r\n\t\t\t\t\t\t\"LogOnConsole\"              {WriteWordLine 0 2 \"Log on to console\"}\r\n\t\t\t\t\t\t\"LogOnWIConsole\"            {WriteWordLine 0 2 \"Logon on to Web Interface console\"}\r\n\t\t\t\t\t\t\"ViewLoadEvaluators\"        {WriteWordLine 0 2 \"View load evaluators\"}\r\n\t\t\t\t\t\t\"AssignLoadEvaluators\"      {WriteWordLine 0 2 \"Assign load evaluators\"}\r\n\t\t\t\t\t\t\"EditLoadEvaluators\"        {WriteWordLine 0 2 \"Edit load evaluators\"}\r\n\t\t\t\t\t\t\"ViewLoadBalancingPolicies\" {WriteWordLine 0 2 \"View load balancing policies\"}\r\n\t\t\t\t\t\t\"EditLoadBalancingPolicies\" {WriteWordLine 0 2 \"Edit load balancing policies\"}\r\n\t\t\t\t\t\t\"ViewPrinterDrivers\"        {WriteWordLine 0 2 \"View printer drivers\"}\r\n\t\t\t\t\t\t\"ReplicatePrinterDrivers\"   {WriteWordLine 0 2 \"Replicate printer drivers\"}\r\n\t\t\t\t\t\tDefault {WriteWordLine 0 2 \"Farm privileges could not be determined: $($farmprivilege)\"}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing folder privileges\"\r\n\t\t\t\tWriteWordLine 0 1 \"Folder Privileges:\"\r\n\t\t\t\tForEach($folderprivilege in $Administrator.FolderPrivileges) \r\n\t\t\t\t{\r\n\t\t\t\t\t#The Citrix PoSH cmdlet only returns data for three folders:\r\n\t\t\t\t\t#Servers\r\n\t\t\t\t\t#WorkerGroups\r\n\t\t\t\t\t#Applications\r\n\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tProcessing folder permissions for $($FolderPrivilege.FolderPath)\"\r\n\t\t\t\t\tWriteWordLine 0 2 $FolderPrivilege.FolderPath\r\n\t\t\t\t\tForEach($FolderPermission in $FolderPrivilege.FolderPrivileges)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSwitch ($folderpermission)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"Unknown\"                          {WriteWordLine 0 3 \"Unknown\"}\r\n\t\t\t\t\t\t\t\"ViewApplications\"                 {WriteWordLine 0 3 \"View applications\"}\r\n\t\t\t\t\t\t\t\"EditApplications\"                 {WriteWordLine 0 3 \"Edit applications\"}\r\n\t\t\t\t\t\t\t\"TerminateProcessApplication\"      {WriteWordLine 0 3 \"Terminate process that is created as a result of launching a published application\"}\r\n\t\t\t\t\t\t\t\"AssignApplicationsToServers\"      {WriteWordLine 0 3 \"Assign applications to servers\"}\r\n\t\t\t\t\t\t\t\"ViewServers\"                      {WriteWordLine 0 3 \"View servers\"}\r\n\t\t\t\t\t\t\t\"EditOtherServerSettings\"          {WriteWordLine 0 3 \"Edit other server settings\"}\r\n\t\t\t\t\t\t\t\"RemoveServer\"                     {WriteWordLine 0 3 \"Remove a bad server from farm\"}\r\n\t\t\t\t\t\t\t\"TerminateProcess\"                 {WriteWordLine 0 3 \"Terminate processes on a server\"}\r\n\t\t\t\t\t\t\t\"ViewSessions\"                     {WriteWordLine 0 3 \"View ICA\/RDP sessions\"}\r\n\t\t\t\t\t\t\t\"ConnectSessions\"                  {WriteWordLine 0 3 \"Connect sessions\"}\r\n\t\t\t\t\t\t\t\"DisconnectSessions\"               {WriteWordLine 0 3 \"Disconnect sessions\"}\r\n\t\t\t\t\t\t\t\"LogOffSessions\"                   {WriteWordLine 0 3 \"Log off sessions\"}\r\n\t\t\t\t\t\t\t\"ResetSessions\"                    {WriteWordLine 0 3 \"Reset sessions\"}\r\n\t\t\t\t\t\t\t\"SendMessages\"                     {WriteWordLine 0 3 \"Send messages to sessions\"}\r\n\t\t\t\t\t\t\t\"ViewWorkerGroups\"                 {WriteWordLine 0 3 \"View worker groups\"}\r\n\t\t\t\t\t\t\t\"AssignApplicationsToWorkerGroups\" {WriteWordLine 0 3 \"Assign applications to worker groups\"}\r\n\t\t\t\t\t\t\tDefault {WriteWordLine 0 3 \"Folder permission could not be determined: $($folderpermissions)\"}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\t#WriteWordLine 0 0 \"\"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 $Administrator.AdministratorName\r\n\t\t\t$TotalAdmins++\r\n\t\t}\r\n\t}\r\n}\r\nElse \r\n{\r\n\tWrite-Warning \"Administrator information could not be retrieved\"\r\n}\r\n$Administrators = $Null\r\nWrite-Verbose \"$(Get-Date): Finished Processing Administrators\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\nWrite-Verbose \"$(Get-Date): Processing Applications\"\r\n\r\nWrite-Verbose \"$(Get-Date): `tSetting summary variables\"\r\n[int]$TotalPublishedApps = 0\r\n[int]$TotalPublishedContent = 0\r\n[int]$TotalPublishedDesktops = 0\r\n[int]$TotalStreamedApps = 0\r\n[int]$TotalApps = 0\r\n$SessionSharingItems = @()\r\n\r\nWrite-Verbose \"$(Get-Date): `tRetrieving Applications\"\r\nIf($Summary)\r\n{\r\n\t$Applications = Get-XAApplication -EA 0 | Sort-Object DisplayName\r\n}\r\nElse\r\n{\r\n\t$Applications = Get-XAApplication -EA 0 | Sort-Object FolderPath, DisplayName\r\n}\r\n\r\nIf($? -and $Applications -ne $Null)\r\n{\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Applications:\"\r\n\r\n\tForEach($Application in $Applications)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing application $($Application.BrowserName)\"\r\n\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\tIf($Application.ApplicationType -ne \"ServerDesktop\" -and $Application.ApplicationType -ne \"Content\")\r\n\t\t\t{\r\n\t\t\t\t#create array for appendix A\r\n\t\t\t\t#these items are taken from http:\/\/support.citrix.com\/article\/CTX159159\r\n\t\t\t\t#Some properties that must match on both Applications for Session Sharing to Function are:\r\n\t\t\t\t#\r\n\t\t\t\t#Color depth\r\n\t\t\t\t#Screen Size\r\n\t\t\t\t#Access Control Filters (for SmartAccess)\r\n\t\t\t\t#Sound (unexplained in article)\r\n\t\t\t\t#Drive Mapping (unexplained in article)\r\n\t\t\t\t#Printer Mapping (unexplained in article)\r\n\t\t\t\t#Encryption\r\n\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tGather session sharing info for Appendix A\"\r\n\t\t\t\t$obj = New-Object -TypeName PSObject\r\n\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name ApplicationName      -Value $Application.BrowserName\r\n\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name MaximumColorQuality  -Value $Application.ColorDepth\r\n\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name SessionWindowSize    -Value $Application.WindowType\r\n\r\n\t\t\t\tIf($Application.AccessSessionConditionsEnabled)\r\n\t\t\t\t{\r\n\t\t\t\t\t$tmp = @()\r\n\t\t\t\t\tForEach($filter in $Application.AccessSessionConditions)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp += $filter\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name AccessControlFilters -Value $tmp\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name AccessControlFilters -Value \"None\"\r\n\t\t\t\t}\r\n\t\t\t\t$tmp = $Null\r\n\r\n\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name Encryption           -Value $Application.EncryptionLevel\r\n\t\t\t\t$SessionSharingItems += $obj\r\n\t\t\t}\r\n\t\t\t$AppServerInfoResults = $False\r\n\t\t\t$AppServerInfo = Get-XAApplicationReport -BrowserName $Application.BrowserName -EA 0\r\n\t\t\tIf($?)\r\n\t\t\t{\r\n\t\t\t\t$AppServerInfoResults = $True\r\n\t\t\t}\r\n\t\t\t[bool]$streamedapp = $False\r\n\t\t\tIf($Application.ApplicationType -Contains \"streamedtoclient\" -or $Application.ApplicationType -Contains \"streamedtoserver\")\r\n\t\t\t{\r\n\t\t\t\t$streamedapp = $True\r\n\t\t\t}\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\t$TotalApps++\r\n\t\t}\r\n\r\n\t\t#name properties\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 2 0 $Application.DisplayName\r\n\t\t\tWriteWordLine 0 1 \"Application name`t`t: \" $Application.BrowserName\r\n\t\t\tWriteWordLine 0 1 \"Disable application`t`t: \" -NoNewLine\r\n\t\t\t#weird, if application is enabled, it is disabled!\r\n\t\t\tIf($Application.Enabled) \r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t} \r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\tWriteWordLine 0 1 \"Hide disabled application`t: \" -nonewline\r\n\t\t\t\tIf($Application.HideWhenDisabled)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tIf(![String]::IsNullOrEmpty($Application.Description))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Application description`t`t: \" $Application.Description\r\n\t\t\t}\r\n\r\n\t\t\t#type properties\r\n\t\t\tWriteWordLine 0 1 \"Application Type`t`t: \" -nonewline\r\n\t\t\tSwitch ($Application.ApplicationType)\r\n\t\t\t{\r\n\t\t\t\t\"Unknown\"                            {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\"ServerInstalled\"                    {WriteWordLine 0 0 \"Installed application\"; $TotalPublishedApps++}\r\n\t\t\t\t\"ServerDesktop\"                      {WriteWordLine 0 0 \"Server desktop\"; $TotalPublishedDesktops++}\r\n\t\t\t\t\"Content\"                            {WriteWordLine 0 0 \"Content\"; $TotalPublishedContent++}\r\n\t\t\t\t\"StreamedToServer\"                   {WriteWordLine 0 0 \"Streamed to server\"; $TotalStreamedApps++}\r\n\t\t\t\t\"StreamedToClient\"                   {WriteWordLine 0 0 \"Streamed to client\"; $TotalStreamedApps++}\r\n\t\t\t\t\"StreamedToClientOrInstalled\"        {WriteWordLine 0 0 \"Streamed if possible, otherwise accessed from server as Installed application\"; $TotalStreamedApps++}\r\n\t\t\t\t\"StreamedToClientOrStreamedToServer\" {WriteWordLine 0 0 \"Streamed if possible, otherwise Streamed to server\"; $TotalStreamedApps++}\r\n\t\t\t\tDefault {WriteWordLine 0 0 \"Application Type could not be determined: $($Application.ApplicationType)\"}\r\n\t\t\t}\r\n\t\t\tIf(![String]::IsNullOrEmpty($Application.FolderPath))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Folder path`t`t`t: \" $Application.FolderPath\r\n\t\t\t}\r\n\t\t\tIf(![String]::IsNullOrEmpty($Application.ContentAddress))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Content Address`t`t: \" $Application.ContentAddress\r\n\t\t\t}\r\n\r\n\t\t\t#if a streamed app\r\n\t\t\tIf($streamedapp)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Citrix streaming app profile address`t`t: \" \r\n\t\t\t\tWriteWordLine 0 2 $Application.ProfileLocation\r\n\t\t\t\tWriteWordLine 0 1 \"App to launch from Citrix stream app profile`t: \" \r\n\t\t\t\tWriteWordLine 0 2 $Application.ProfileProgramName\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($Application.ProfileProgramArguments))\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Extra command line parameters`t`t`t: \" \r\n\t\t\t\t\tWriteWordLine 0 2 $Application.ProfileProgramArguments\r\n\t\t\t\t}\r\n\t\t\t\t#if streamed, OffWriteWordLine 0 access properties\r\n\t\t\t\tIf($Application.OfflineAccessAllowed)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Enable offline access`t`t`t`t: \" -nonewline\r\n\t\t\t\t\tIf($Application.OfflineAccessAllowed)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tIf($Application.CachingOption)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Cache preference`t`t`t`t: \" -nonewline\r\n\t\t\t\t\tSwitch ($Application.CachingOption)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Unknown\"   {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\t\"PreLaunch\" {WriteWordLine 0 0 \"Cache application prior to launching\"}\r\n\t\t\t\t\t\t\"AtLaunch\"  {WriteWordLine 0 0 \"Cache application during launch\"}\r\n\t\t\t\t\t\tDefault {WriteWordLine 0 0 \"Could not be determined: $($Application.CachingOption)\"}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t#location properties\r\n\t\t\tIf(!$streamedapp)\r\n\t\t\t{\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($Application.CommandLineExecutable))\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($Application.CommandLineExecutable.Length -lt 40)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Command Line`t`t`t: \" $Application.CommandLineExecutable\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Command Line: \" \r\n\t\t\t\t\t\tWriteWordLine 0 2 $Application.CommandLineExecutable\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tIf(![String]::IsNullOrEmpty($Application.WorkingDirectory))\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($Application.WorkingDirectory.Length -lt 40)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Working directory`t`t: \" $Application.WorkingDirectory\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Working directory: \" \r\n\t\t\t\t\t\tWriteWordLine 0 2 $Application.WorkingDirectory\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t#servers properties\r\n\t\t\t\tIf($AppServerInfoResults)\r\n\t\t\t\t{\r\n\t\t\t\t\tIf(![String]::IsNullOrEmpty($AppServerInfo.ServerNames))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Servers:\"\r\n\t\t\t\t\t\t$TempArray = $AppServerInfo.ServerNames | Sort-Object\r\n\t\t\t\t\t\tBuildTableForServerOrWG $TempArray\r\n\t\t\t\t\t\t$TempArray = $Null\r\n\t\t\t\t\t}\r\n\t\t\t\t\tIf(![String]::IsNullOrEmpty($AppServerInfo.WorkerGroupNames))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Worker Groups:\"\r\n\t\t\t\t\t\t$TempArray = $AppServerInfo.WorkerGroupNames | Sort-Object\r\n\t\t\t\t\t\tBuildTableForServerOrWG $TempArray\r\n\t\t\t\t\t\t$TempArray = $Null\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Unable to retrieve a list of Servers or Worker Groups for this application\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t#users properties\r\n\t\t\tIf($Application.AnonymousConnectionsAllowed)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Allow anonymous users: \" $Application.AnonymousConnectionsAllowed\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tIf($AppServerInfoResults)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Users:\"\r\n\t\t\t\t\tForEach($user in $AppServerInfo.Accounts)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 2 $user\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Unable to retrieve a list of Users for this application\"\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\t#shortcut presentation properties\r\n\t\t\t#application icon is ignored\r\n\t\t\tIf(![String]::IsNullOrEmpty($Application.ClientFolder))\r\n\t\t\t{\r\n\t\t\t\tIf($Application.ClientFolder.Length -lt 30)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Client application folder`t`t`t`t: \" $Application.ClientFolder\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Client application folder`t`t`t`t: \" \r\n\t\t\t\t\tWriteWordLine 0 2 $Application.ClientFolder\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.AddToClientStartMenu)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Add to client's start menu\"\r\n\t\t\t\tIf($Application.StartMenuFolder)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Start menu folder`t`t`t: \" $Application.StartMenuFolder\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.AddToClientDesktop)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Add shortcut to the client's desktop\"\r\n\t\t\t}\r\n\r\n\t\t\t#access control properties\r\n\t\t\tIf($Application.ConnectionsThroughAccessGatewayAllowed)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Allow connections made through AGAE`t`t: \" -nonewline\r\n\t\t\t\tIf($Application.ConnectionsThroughAccessGatewayAllowed)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\t} \r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.OtherConnectionsAllowed)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Any connection`t`t`t`t`t: \" -nonewline\r\n\t\t\t\tIf($Application.OtherConnectionsAllowed)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\t} \r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.AccessSessionConditionsEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Any connection that meets any of the following filters: \" $Application.AccessSessionConditionsEnabled\r\n\t\t\t\tWriteWordLine 0 1 \"Access Gateway Filters:\"\r\n\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t[int]$Rows = $Application.AccessSessionConditions.count + 1\r\n\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t[int]$xRow = 1\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tFormat first row with column headings\"\r\n\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Farm Name\"\r\n\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Filter\"\r\n\t\t\t\tForEach($AccessCondition in $Application.AccessSessionConditions)\r\n\t\t\t\t{\r\n\t\t\t\t\t[string]$Tmp = $AccessCondition\r\n\t\t\t\t\t[string]$AGFarm = $Tmp.substring(0, $Tmp.indexof(\":\"))\r\n\t\t\t\t\t[string]$AGFilter = $Tmp.substring($Tmp.indexof(\":\")+1)\r\n\t\t\t\t\t$xRow++\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tProcessing row for Access Condition $($Tmp)\"\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $AGFarm\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $AGFilter\r\n\t\t\t\t}\r\n\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tMove table to the right\"\r\n\t\t\t\t$Table.Rows.SetLeftIndent(72,1)\r\n\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t#return focus back to document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tReturn focus back to document\"\r\n\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t#move to the end of the current document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tMove to the end of the current document\"\r\n\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t$tmp = $Null\r\n\t\t\t\t$AGFarm = $Null\r\n\t\t\t\t$AGFilter = $Null\r\n\t\t\t}\r\n\r\n\t\t\t#content redirection properties\r\n\t\t\tIf($AppServerInfoResults)\r\n\t\t\t{\r\n\t\t\t\tIf($AppServerInfo.FileTypes)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"File type associations:\"\r\n\t\t\t\t\tForEach($filetype in $AppServerInfo.FileTypes)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 2 $filetype\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"File Type Associations for this application`t: None\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Unable to retrieve the list of FTAs for this application\"\r\n\t\t\t}\r\n\r\n\t\t\t#if streamed app, Alternate profiles\r\n\t\t\tIf($streamedapp)\r\n\t\t\t{\r\n\t\t\t\tIf($Application.AlternateProfiles)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Primary application profile location`t`t: \" $Application.AlternateProfiles\r\n\t\t\t\t}\r\n\r\n\t\t\t\t#if streamed app, User privileges properties\r\n\t\t\t\tIf($Application.RunAsLeastPrivilegedUser)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 1 \"Run app as a least-privileged user account`t: \" $Application.RunAsLeastPrivilegedUser\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t#limits properties\r\n\t\t\tWriteWordLine 0 1 \"Limit instances allowed to run in server farm`t: \" -NoNewLine\r\n\r\n\t\t\tIf($Application.InstanceLimit -eq -1)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"No limit set\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 $Application.InstanceLimit\r\n\t\t\t}\r\n\r\n\t\t\tWriteWordLine 0 1 \"Allow only 1 instance of app for each user`t: \" -NoNewLine\r\n\r\n\t\t\tIf($Application.MultipleInstancesPerUserAllowed) \r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t} \r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t}\r\n\r\n\t\t\tIf($Application.CpuPriorityLevel)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Application importance`t`t`t`t: \" -nonewline\r\n\t\t\t\tSwitch ($Application.CpuPriorityLevel)\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Unknown\"     {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\"BelowNormal\" {WriteWordLine 0 0 \"Below Normal\"}\r\n\t\t\t\t\t\"Low\"         {WriteWordLine 0 0 \"Low\"}\r\n\t\t\t\t\t\"Normal\"      {WriteWordLine 0 0 \"Normal\"}\r\n\t\t\t\t\t\"AboveNormal\" {WriteWordLine 0 0 \"Above Normal\"}\r\n\t\t\t\t\t\"High\"        {WriteWordLine 0 0 \"High\"}\r\n\t\t\t\t\tDefault {WriteWordLine 0 0 \"Application importance could not be determined: $($Application.CpuPriorityLevel)\"}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t#client options properties\r\n\t\t\tWriteWordLine 0 1 \"Enable legacy audio`t`t`t`t: \" -nonewline\r\n\t\t\tSwitch ($Application.AudioType)\r\n\t\t\t{\r\n\t\t\t\t\"Unknown\" {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\"None\"    {WriteWordLine 0 0 \"Not Enabled\"}\r\n\t\t\t\t\"Basic\"   {WriteWordLine 0 0 \"Enabled\"}\r\n\t\t\t\tDefault {WriteWordLine 0 0 \"Enable legacy audio could not be determined: $($Application.AudioType)\"}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 1 \"Minimum requirement`t`t`t`t: \" -nonewline\r\n\t\t\tIf($Application.AudioRequired)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Enabled\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Disabled\"\r\n\t\t\t}\r\n\t\t\tIf($Application.SslConnectionEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Enable SSL and TLS protocols`t`t`t: \" -nonewline\r\n\t\t\t\tIf($Application.SslConnectionEnabled)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Enabled\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Disabled\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.EncryptionLevel)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Encryption`t`t`t`t`t: \" -nonewline\r\n\t\t\t\tSwitch ($Application.EncryptionLevel)\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Unknown\" {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\"Basic\"   {WriteWordLine 0 0 \"Basic\"}\r\n\t\t\t\t\t\"LogOn\"   {WriteWordLine 0 0 \"128-Bit Login Only (RC-5)\"}\r\n\t\t\t\t\t\"Bits40\"  {WriteWordLine 0 0 \"40-Bit (RC-5)\"}\r\n\t\t\t\t\t\"Bits56\"  {WriteWordLine 0 0 \"56-Bit (RC-5)\"}\r\n\t\t\t\t\t\"Bits128\" {WriteWordLine 0 0 \"128-Bit (RC-5)\"}\r\n\t\t\t\t\tDefault {WriteWordLine 0 0 \"Encryption could not be determined: $($Application.EncryptionLevel)\"}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.EncryptionRequired)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Minimum requirement`t`t`t`t: \" -nonewline\r\n\t\t\t\tIf($Application.EncryptionRequired)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Enabled\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Disabled\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tWriteWordLine 0 1 \"Start app w\/o waiting for printer creation`t: \" -NoNewLine\r\n\t\t\t#another weird one, if True then this is Disabled\r\n\t\t\tIf($Application.WaitOnPrinterCreation) \r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Disabled\"\r\n\t\t\t} \r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Enabled\"\r\n\t\t\t}\r\n\r\n\t\t\t#appearance properties\r\n\t\t\tIf($Application.WindowType)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Session window size`t`t`t`t: \" $Application.WindowType\r\n\t\t\t}\r\n\t\t\tIf($Application.ColorDepth)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Maximum color quality`t`t`t`t: \" -nonewline\r\n\t\t\t\tSwitch ($Application.ColorDepth)\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Unknown\"     {WriteWordLine 0 0 \"Unknown color depth\"}\r\n\t\t\t\t\t\"Colors8Bit\"  {WriteWordLine 0 0 \"256-color (8-bit)\"}\r\n\t\t\t\t\t\"Colors16Bit\" {WriteWordLine 0 0 \"Better Speed (16-bit)\"}\r\n\t\t\t\t\t\"Colors32Bit\" {WriteWordLine 0 0 \"Better Appearance (32-bit)\"}\r\n\t\t\t\t\tDefault {WriteWordLine 0 0 \"Maximum color quality could not be determined: $($Application.ColorDepth)\"}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.TitleBarHidden)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Hide application title bar`t`t`t: \" -nonewline\r\n\t\t\t\tIf($Application.TitleBarHidden)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Enabled\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Disabled\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($Application.MaximizedOnStartup)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Maximize application at startup`t`t`t: \" -nonewline\r\n\t\t\t\tIf($Application.MaximizedOnStartup)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Enabled\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Disabled\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$AppServerInfo = $Null\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 $Application.DisplayName\r\n\t\t}\r\n\t}\r\n}\r\nElseIf($Applications -eq $Null)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): There are no Applications published\"\r\n}\r\nElse \r\n{\r\n\tWrite-Warning \"Application information could not be retrieved.\"\r\n}\r\n$Applications = $Null\r\nWrite-Verbose \"$(Get-Date): Finished Processing Applications\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\nIf(!$Summary)\r\n{\r\n\r\n\t[int]$TotalConfigLogItems = 0\r\n\r\n\tWrite-Verbose \"$(Get-Date): Processing Configuration Logging\/History Report\"\r\n\tIf($ConfigLog)\r\n\t{\r\n\t\t#history AKA Configuration Logging report\r\n\t\t#only process if $ConfigLog = $True and XA65ConfigLog.udl file exists\r\n\t\t#build connection string\r\n\t\t#User ID is account that has access permission for the configuration logging database\r\n\t\t#Initial Catalog is the name of the Configuration Logging SQL Database\r\n\t\t#bug fixed by Esther Barthel\r\n\t\tIf(Test-Path \"$($pwd.path)\\XA65ConfigLog.udl\")\r\n\t\t{\r\n\t\t\t$ConnectionString = Get-Content \"$($pwd.path)\\XA65ConfigLog.udl\" | select-object -last 1\r\n\t\t\t$ConfigLogReport = get-CtxConfigurationLogReport -connectionstring $ConnectionString -TimePeriodFrom $StartDate -TimePeriodTo $EndDate -EA 0\r\n\r\n\t\t\tIf($? -and $ConfigLogReport)\r\n\t\t\t{\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `tProcessing $($ConfigLogReport.Count) history items\"\r\n\t\t\t\t$selection.InsertNewPage()\r\n\t\t\t\tWriteWordLine 1 0 \"History:\"\r\n\t\t\t\t$TableRange   = $doc.Application.Selection.Range\r\n\t\t\t\t[int]$Columns = 6\r\n\t\t\t\tIf($ConfigLogReport -is [array])\r\n\t\t\t\t{\r\n\t\t\t\t\t[int]$Rows = $ConfigLogReport.Count +1\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t[int]$Rows = 2\r\n\t\t\t\t}\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): Add Configuration Logging table to doc\"\r\n\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t$table.Style = \"Table Grid\"\r\n\t\t\t\t$table.Borders.InsideLineStyle = 0\r\n\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t$Table.Cell(1,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell(1,1).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell(1,1).Range.Text = \"Date\"\r\n\t\t\t\t$Table.Cell(1,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell(1,2).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell(1,2).Range.Text = \"Account\"\r\n\t\t\t\t$Table.Cell(1,3).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell(1,3).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell(1,3).Range.Text = \"Change description\"\r\n\t\t\t\t$Table.Cell(1,4).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell(1,4).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell(1,4).Range.Text = \"Type of change\"\r\n\t\t\t\t$Table.Cell(1,5).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell(1,5).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell(1,5).Range.Text = \"Type of item\"\r\n\t\t\t\t$Table.Cell(1,6).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell(1,6).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell(1,6).Range.Text = \"Name of item\"\r\n\t\t\t\t$xRow = 1\r\n\t\t\t\tForEach($Item in $ConfigLogReport)\r\n\t\t\t\t{\r\n\t\t\t\t\t$xRow++\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): Adding row for $($Item.Description)\"\r\n\t\t\t\t\tIf($xRow % 2 -eq 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray05\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray05\r\n\t\t\t\t\t\t$Table.Cell($xRow,3).Shading.BackgroundPatternColor = $wdColorGray05\r\n\t\t\t\t\t\t$Table.Cell($xRow,4).Shading.BackgroundPatternColor = $wdColorGray05\r\n\t\t\t\t\t\t$Table.Cell($xRow,5).Shading.BackgroundPatternColor = $wdColorGray05\r\n\t\t\t\t\t\t$Table.Cell($xRow,6).Shading.BackgroundPatternColor = $wdColorGray05\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.size = 9\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $Item.Date\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.size = 9\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $Item.Account\r\n\t\t\t\t\t$Table.Cell($xRow,3).Range.Font.size = 9\r\n\t\t\t\t\t$Table.Cell($xRow,3).Range.Text = $Item.Description\r\n\t\t\t\t\t$Table.Cell($xRow,4).Range.Font.size = 9\r\n\t\t\t\t\t$Table.Cell($xRow,4).Range.Text = $Item.TaskType\r\n\t\t\t\t\t$Table.Cell($xRow,5).Range.Font.size = 9\r\n\t\t\t\t\t$Table.Cell($xRow,5).Range.Text = $Item.ItemType\r\n\t\t\t\t\t$Table.Cell($xRow,6).Range.Font.size = 9\r\n\t\t\t\t\t$Table.Cell($xRow,6).Range.Text = $Item.ItemName\r\n\t\t\t\t}\r\n\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t#return focus back to document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): Return focus back to document\"\r\n\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView=$wdSeekMainDocument\r\n\r\n\t\t\t\t#move to the end of the current document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): Move to the end of the current document\"\r\n\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t}\r\n\t\t}\r\n\t\tElse \r\n\t\t{\r\n\t\t\tWrite-Warning \"Configuration Logging is enabled but the XA65ConfigLog.udl file was not found\"\r\n\t\t}\r\n\t\t$ConnectionString = $Null\r\n\t\t$ConfigLogReport = $Null\r\n\t}\r\n\r\n\tWrite-Verbose \"$(Get-Date): Finished Processing Configuration Logging\/History Report\"\r\n\tWrite-Verbose \"$(Get-Date): \"\r\n}\r\n\r\n#load balancing policies\r\nWrite-Verbose \"$(Get-Date): Processing Load Balancing Policies\"\r\nWrite-Verbose \"$(Get-Date): `tSetting summary variables\"\r\n[int]$TotalLBPolicies = 0\r\n\r\nWrite-Verbose \"$(Get-Date): `tRetrieving Load Balancing Policies\"\r\n$LoadBalancingPolicies = Get-XALoadBalancingPolicy -EA 0 | Sort-Object PolicyName\r\n\r\nIf($? -and $LoadBalancingPolicies -ne $Null)\r\n{\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Load Balancing Policies:\"\r\n\tForEach($LoadBalancingPolicy in $LoadBalancingPolicies)\r\n\t{\r\n\t\t$TotalLBPolicies++\r\n\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Load Balancing Policy $($LoadBalancingPolicy.PolicyName)\"\r\n\t\t$LoadBalancingPolicyConfiguration = Get-XALoadBalancingPolicyConfiguration -PolicyName $LoadBalancingPolicy.PolicyName -EA 0\r\n\t\t$LoadBalancingPolicyFilter = Get-XALoadBalancingPolicyFilter -PolicyName $LoadBalancingPolicy.PolicyName -EA 0\r\n\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 2 0 $LoadBalancingPolicy.PolicyName\r\n\t\t\tIf(![String]::IsNullOrEmpty($LoadBalancingPolicy.Description))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Description`t: \" $LoadBalancingPolicy.Description\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 1 \"Enabled`t`t: \" -nonewline\r\n\t\t\tIf($LoadBalancingPolicy.Enabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 1 \"Priority`t`t: \" $LoadBalancingPolicy.Priority\r\n\r\n\t\t\tWriteWordLine 0 1 \"Filter based on Access Control: \" -nonewline\r\n\t\t\tIf($LoadBalancingPolicyFilter.AccessControlEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t}\r\n\t\t\tIf($LoadBalancingPolicyFilter.AccessControlEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Apply to connections made through Access Gateway: \" -nonewline\r\n\t\t\t\tIf($LoadBalancingPolicyFilter.AllowConnectionsThroughAccessGateway)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t\t}\r\n\t\t\t\tIf($LoadBalancingPolicyFilter.AllowConnectionsThroughAccessGateway)\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($LoadBalancingPolicyFilter.AllowOtherConnections)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 2 \"Any connection\"\r\n\t\t\t\t\t} \r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 2 \"Any connection that meets any of the following filters\"\r\n\t\t\t\t\t\tIf($LoadBalancingPolicyFilter.AccessSessionConditions)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tCreate table for Load Balancing Policy Access Session Condition\"\r\n\t\t\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t\t\t\t[int]$Rows = $LoadBalancingPolicyFilter.AccessSessionConditions.count + 1\r\n\t\t\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tFormat first row with column headings\"\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Farm Name\"\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Filter\"\r\n\t\t\t\t\t\t\tForEach($AccessSessionCondition in $LoadBalancingPolicyFilter.AccessSessionConditions)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t[string]$Tmp = $AccessSessionCondition\r\n\t\t\t\t\t\t\t\t[string]$AGFarm = $Tmp.substring(0, $Tmp.indexof(\":\"))\r\n\t\t\t\t\t\t\t\t[string]$AGFilter = $Tmp.substring($Tmp.indexof(\":\")+1)\r\n\t\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t`tProcessing row for Access Session Condition $($Tmp)\"\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $AGFarm\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $AGFilter\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tMove table to the right\"\r\n\t\t\t\t\t\t\t$Table.Rows.SetLeftIndent(72,1)\r\n\t\t\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tReturn focus back to document\"\r\n\t\t\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tMove to the end of the current document\"\r\n\t\t\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\t\t\t$tmp = $Null\r\n\t\t\t\t\t\t\t$AGFarm = $Null\r\n\t\t\t\t\t\t\t$AGFilter = $Null\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadBalancingPolicyFilter.ClientIPAddressEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Filter based on client IP address\"\r\n\t\t\t\tIf($LoadBalancingPolicyFilter.ApplyToAllClientIPAddresses)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Apply to all client IP addresses\"\r\n\t\t\t\t} \r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($LoadBalancingPolicyFilter.AllowedIPAddresses)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tForEach($AllowedIPAddress in $LoadBalancingPolicyFilter.AllowedIPAddresses)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Client IP Address Matched: \" $AllowedIPAddress\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tIf($LoadBalancingPolicyFilter.DeniedIPAddresses)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tForEach($DeniedIPAddress in $LoadBalancingPolicyFilter.DeniedIPAddresses)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Client IP Address Ignored: \" $DeniedIPAddress\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($LoadBalancingPolicyFilter.ClientNameEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Filter based on client name\"\r\n\t\t\t\tIf($LoadBalancingPolicyFilter.ApplyToAllClientNames)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Apply to all client names\"\r\n\t\t\t\t} \r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($LoadBalancingPolicyFilter.AllowedClientNames)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tForEach($AllowedClientName in $LoadBalancingPolicyFilter.AllowedClientNames)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Client Name Matched: \" $AllowedClientName\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tIf($LoadBalancingPolicyFilter.DeniedClientNames)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tForEach($DeniedClientName in $LoadBalancingPolicyFilter.DeniedClientNames)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"Client Name Ignored: \" $DeniedClientName\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($LoadBalancingPolicyFilter.AccountEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Filter based on user\"\r\n\t\t\t\tWriteWordLine 0 2 \"Apply to anonymous users: \" -nonewline\r\n\t\t\t\tIf($LoadBalancingPolicyFilter.ApplyToAnonymousAccounts)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"Yes\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 0 \"No\"\r\n\t\t\t\t}\r\n\t\t\t\tIf($LoadBalancingPolicyFilter.ApplyToAllExplicitAccounts)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Apply to all explicit (non-anonymous) users\"\r\n\t\t\t\t} \r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tIf($LoadBalancingPolicyFilter.AllowedAccounts)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tForEach($AllowedAccount in $LoadBalancingPolicyFilter.AllowedAccounts)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"User Matched: \" $AllowedAccount\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tIf($LoadBalancingPolicyFilter.DeniedAccounts)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tForEach($DeniedAccount in $LoadBalancingPolicyFilter.DeniedAccounts)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWriteWordLine 0 2 \"User Ignored: \" $DeniedAccount\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($LoadBalancingPolicyConfiguration.WorkerGroupPreferenceAndFailoverState)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Configure application connection preference based on worker group\"\r\n\t\t\t\tIf($LoadBalancingPolicyConfiguration.WorkerGroupPreferences)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tCreate table for Load Balancing Policy Worker Group Filter\"\r\n\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t\t[int]$Rows = $LoadBalancingPolicyConfiguration.WorkerGroupPreferences.count + 1\r\n\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tFormat first row with column headings\"\r\n\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Worker Group\"\r\n\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Priority\"\r\n\t\t\t\t\tForEach($WorkerGroupPreference in $LoadBalancingPolicyConfiguration.WorkerGroupPreferences)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t[string]$Tmp = $WorkerGroupPreference\r\n\t\t\t\t\t\t[string]$WGName = $Tmp.substring($Tmp.indexof(\"=\")+1)\r\n\t\t\t\t\t\t[string]$WGPriority = $Tmp.substring($Tmp.indexof(\":\")+1, (($Tmp.indexof(\"=\")-1)-$Tmp.indexof(\":\")))\r\n\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing row for Worker Group Filter $($Tmp)\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $WGName\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $WGPriority\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tMove table to the right\"\r\n\t\t\t\t\t$Table.Rows.SetLeftIndent(72,1)\r\n\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tReturn focus back to document\"\r\n\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`tMove to the end of the current document\"\r\n\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\t$tmp = $Null\r\n\t\t\t\t\t$WGName = $Null\r\n\t\t\t\t\t$WGPriority = $Null\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tIf($LoadBalancingPolicyConfiguration.StreamingDeliveryProtocolState -eq \"Enabled\")\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Set the delivery protocols for applications streamed to client\"\r\n\t\t\t\tWriteWordLine 0 2 \"\" -nonewline\r\n\t\t\t\tSwitch ($LoadBalancingPolicyConfiguration.StreamingDeliveryOption)\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Unknown\"                {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\"ForceServerAccess\"      {WriteWordLine 0 0 \"Do not allow applications to stream to the client\"}\r\n\t\t\t\t\t\"ForcedStreamedDelivery\" {WriteWordLine 0 0 \"Force applications to stream to the client\"}\r\n\t\t\t\t\tDefault {WriteWordLine 0 0 \"Delivery protocol could not be determined: $($LoadBalancingPolicyConfiguration.StreamingDeliveryOption)\"}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tElseif($LoadBalancingPolicyConfiguration.StreamingDeliveryProtocolState -eq \"Disabled\")\r\n\t\t\t{\r\n\t\t\t\t#In the GUI, if \"Set the delivery protocols for applications streamed to client\" IS selected AND \r\n\t\t\t\t#\"Allow applications to stream to the client or run on a Terminal Server (Default)\" IS selected\r\n\t\t\t\t#then \"Set the delivery protocols for applications streamed to client\" is set to Disabled\r\n\t\t\t\tWriteWordLine 0 1 \"Set the delivery protocols for applications streamed to client\"\r\n\t\t\t\tWriteWordLine 0 2 \"Allow applications to stream to the client or run on a Terminal Server (Default)\"\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Streamed App Delivery is not configured\"\r\n\t\t\t}\r\n\r\n\t\t\t$LoadBalancingPolicyConfiguration = $Null\r\n\t\t\t$LoadBalancingPolicyFilter = $Null\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 $LoadBalancingPolicy.PolicyName\r\n\t\t}\r\n\t}\r\n}\r\nElseif($LoadBalancingPolicies -eq $Null)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): There are no Load balancing policies created\"\r\n}\r\nElse \r\n{\r\n\tWrite-Warning \"Load balancing policy information could not be retrieved.  \"\r\n}\r\n$LoadBalancingPolicies = $Null\r\nWrite-Verbose \"$(Get-Date): Finished Processing Load Balancing Policies\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\n#load evaluators\r\nWrite-Verbose \"$(Get-Date): Processing Load Evaluators\"\r\nWrite-Verbose \"$(Get-Date): `tSetting summary variables\"\r\n[int]$TotalLoadEvaluators = 0\r\n\r\nWrite-Verbose \"$(Get-Date): `tRetrieving Load Evaluators\"\r\n$LoadEvaluators = Get-XALoadEvaluator -EA 0 | Sort-Object LoadEvaluatorName\r\n\r\nIf($?)\r\n{\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Load Evaluators:\"\r\n\tForEach($LoadEvaluator in $LoadEvaluators)\r\n\t{\r\n\t\t$TotalLoadEvaluators++\r\n\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Load Evaluator $($LoadEvaluator.LoadEvaluatorName)\"\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 2 0 $LoadEvaluator.LoadEvaluatorName\r\n\t\t\tIf(![String]::IsNullOrEmpty($LoadEvaluator.Description))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Description: \" $LoadEvaluator.Description\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.IsBuiltIn)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Built-in Load Evaluator\"\r\n\t\t\t} \r\n\t\t\tElse \r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"User created load evaluator\"\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.ApplicationUserLoadEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Application User Load Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the # of users for this application equals: \" $LoadEvaluator.ApplicationUserLoad\r\n\t\t\t\tWriteWordLine 0 2 \"Application: \" $LoadEvaluator.ApplicationBrowserName\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.ContextSwitchesEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Context Switches Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the # of context Switches per second is &gt; than: \" $LoadEvaluator.ContextSwitches[1]\r\n\t\t\t\tWriteWordLine 0 2 \"Report no load when the # of context Switches per second is &lt;= to: \" $LoadEvaluator.ContextSwitches[0]\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.CpuUtilizationEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"CPU Utilization Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the processor utilization % is &gt; than: \" $LoadEvaluator.CpuUtilization[1]\r\n\t\t\t\tWriteWordLine 0 2 \"Report no load when the processor utilization % is &lt;= to: \" $LoadEvaluator.CpuUtilization[0]\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.DiskDataIOEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Disk Data I\/O Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the total disk I\/O in kbps is &gt; than: \" $LoadEvaluator.DiskDataIO[1]\r\n\t\t\t\tWriteWordLine 0 2 \"Report no load when the total disk I\/O in kbps per second is &lt;= to: \" $LoadEvaluator.DiskDataIO[0]\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.DiskOperationsEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Disk Operations Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the total # of R\/W operations per second is &gt; than: \" $LoadEvaluator.DiskOperations[1]\r\n\t\t\t\tWriteWordLine 0 2 \"Report no load when the total # of R\/W operations per second is &lt;= to: \" $LoadEvaluator.DiskOperations[0]\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.IPRangesEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"IP Range Settings\"\r\n\t\t\t\tIf($LoadEvaluator.IPRangesAllowed)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Allow \" -NoNewLine\r\n\t\t\t\t} \r\n\t\t\t\tElse \r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Deny \" -NoNewLine\r\n\t\t\t\t}\r\n\t\t\t\tWriteWordLine 0 0 \"client connections from the listed IP Ranges\"\r\n\t\t\t\tForEach($IPRange in $LoadEvaluator.IPRanges)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 3 \"IP Address Ranges: \" $IPRange\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.LoadThrottlingEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Load Throttling Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Impact of logons on load: \" -nonewline\r\n\t\t\t\tSwitch ($LoadEvaluator.LoadThrottling)\r\n\t\t\t\t{\r\n\t\t\t\t\t\"Unknown\"    {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\"Extreme\"    {WriteWordLine 0 0 \"Extreme\"}\r\n\t\t\t\t\t\"High\"       {WriteWordLine 0 0 \"High (Default)\"}\r\n\t\t\t\t\t\"MediumHigh\" {WriteWordLine 0 0 \"Medium High\"}\r\n\t\t\t\t\t\"Medium\"     {WriteWordLine 0 0 \"Medium\"}\r\n\t\t\t\t\t\"MediumLow\"  {WriteWordLine 0 0 \"Medium Low\"}\r\n\t\t\t\t\tDefault {WriteWordLine 0 0 \"Impact of logons on load could not be determined: $($LoadEvaluator.LoadThrottling)\"}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.MemoryUsageEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Memory Usage Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the memory usage is &gt; than: \" $LoadEvaluator.MemoryUsage[1]\r\n\t\t\t\tWriteWordLine 0 2 \"Report no load when the memory usage is &lt;= to: \" $LoadEvaluator.MemoryUsage[0]\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.PageFaultsEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Page Faults Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the # of page faults per second is &gt; than: \" $LoadEvaluator.PageFaults[1]\r\n\t\t\t\tWriteWordLine 0 2 \"Report no load when the # of page faults per second is &lt;= to: \" $LoadEvaluator.PageFaults[0]\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.PageSwapsEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Page Swaps Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the # of page swaps per second is &gt; than: \" $LoadEvaluator.PageSwaps[1]\r\n\t\t\t\tWriteWordLine 0 2 \"Report no load when the # of page swaps per second is &lt;= to: \" $LoadEvaluator.PageSwaps[0]\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.ScheduleEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Scheduling Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Sunday Schedule`t: \" $LoadEvaluator.SundaySchedule\r\n\t\t\t\tWriteWordLine 0 2 \"Monday Schedule`t: \" $LoadEvaluator.MondaySchedule\r\n\t\t\t\tWriteWordLine 0 2 \"Tuesday Schedule`t: \" $LoadEvaluator.TuesdaySchedule\r\n\t\t\t\tWriteWordLine 0 2 \"Wednesday Schedule`t: \" $LoadEvaluator.WednesdaySchedule\r\n\t\t\t\tWriteWordLine 0 2 \"Thursday Schedule`t: \" $LoadEvaluator.ThursdaySchedule\r\n\t\t\t\tWriteWordLine 0 2 \"Friday Schedule`t`t: \" $LoadEvaluator.FridaySchedule\r\n\t\t\t\tWriteWordLine 0 2 \"Saturday Schedule`t: \" $LoadEvaluator.SaturdaySchedule\r\n\t\t\t}\r\n\r\n\t\t\tIf($LoadEvaluator.ServerUserLoadEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Server User Load Settings\"\r\n\t\t\t\tWriteWordLine 0 2 \"Report full load when the # of server users equals: \" $LoadEvaluator.ServerUserLoad\r\n\t\t\t}\r\n\r\n\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 $LoadEvaluator.LoadEvaluatorName\r\n\t\t}\r\n\t}\r\n}\r\nElse \r\n{\r\n\tWrite-Warning \"Load Evaluator information could not be retrieved\"\r\n}\r\n$LoadEvaluators = $Null\r\nWrite-Verbose \"$(Get-Date): Finished Processing Load Evaluators\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\n#servers\r\nWrite-Verbose \"$(Get-Date): Processing Servers\"\r\nWrite-Verbose \"$(Get-Date): `tSetting summary variables\"\r\n[int]$TotalControllers = 0\r\n[int]$TotalWorkers = 0\r\n[int]$TotalServers = 0\r\n$ServerItems = @()\r\n\r\nWrite-Verbose \"$(Get-Date): `tRetrieving Servers\"\r\nIf($Summary)\r\n{\r\n\t$servers = Get-XAServer -EA 0 | Sort-Object ServerName\r\n}\r\nElse\r\n{\r\n\t$servers = Get-XAServer -EA 0 | Sort-Object FolderPath, ServerName\r\n}\r\n\r\nIf($?)\r\n{\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Servers:\"\r\n\tForEach($server in $servers)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing server $($server.ServerName)\"\r\n\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\t[bool]$SvrOnline = $False\r\n\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tTesting to see if $($server.ServerName) is online and reachable\"\r\n\t\t\tIf(Test-Connection -ComputerName $server.servername -quiet -EA 0)\r\n\t\t\t{\r\n\t\t\t\t$SvrOnline = $True\r\n\t\t\t\tIf($Hardware -and $Software)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t$($server.ServerName) is online.  Hardware inventory, Software Inventory, Citrix Services and Hotfix areas will be processed.\"\r\n\t\t\t\t}\r\n\t\t\t\tElseIf($Hardware -and !($Software))\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t$($server.ServerName) is online.  Hardware inventory, Citrix Services and Hotfix areas will be processed.\"\r\n\t\t\t\t}\r\n\t\t\t\tElseIf(!($Hardware) -and $Software)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t$($server.ServerName) is online.  Software Inventory, Citrix Services and Hotfix areas will be processed.\"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`t`t$($server.ServerName) is online.  Citrix Services and Hotfix areas will be processed.\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t#create array for appendix B\r\n\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tGather server info for Appendix B\"\r\n\t\t\t$obj = New-Object -TypeName PSObject\r\n\t\t\t$obj | Add-Member -MemberType NoteProperty -Name ServerName -Value $server.ServerName\r\n\t\t\t$obj | Add-Member -MemberType NoteProperty -Name ZoneName -Value $server.ZoneName\r\n\t\t\t$obj | Add-Member -MemberType NoteProperty -Name OSVersion -Value $server.OSVersion\r\n\t\t\t$obj | Add-Member -MemberType NoteProperty -Name CitrixVersion -Value $server.CitrixVersion\r\n\t\t\t$obj | Add-Member -MemberType NoteProperty -Name ProductEdition -Value $server.CitrixEdition\r\n\t\t\t$obj | Add-Member -MemberType NoteProperty -Name LicenseServer -Value $Server.LicenseServerName\t\t\t\r\n\r\n\t\t\tIf($SvrOnline)\r\n\t\t\t{\r\n\t\t\t\t$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $server.ServerName)\r\n\t\t\t\tTry\r\n\t\t\t\t{\r\n\t\t\t\t\t$RegKey= $Reg.OpenSubKey(\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Citrix\\\\Wfshell\\\\TWI\")\r\n\t\t\t\t\t$SSDisabled = $RegKey.GetValue(\"SeamlessFlags\")\r\n\r\n\t\t\t\t\tIf($SSDisabled -eq 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name SessionSharing -Value \"Disabled\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name SessionSharing -Value \"Enabled\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tCatch\r\n\t\t\t\t{\r\n\t\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name SessionSharing -Value \"Not Available\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name SessionSharing -Value \"Server Offline\"\r\n\t\t\t}\r\n\r\n\t\t\t$ServerItems += $obj\r\n\r\n\t\t\tWriteWordLine 2 0 $server.ServerName\r\n\t\t\tWriteWordLine 0 1 \"Product`t`t`t`t: \" $server.CitrixProductName\r\n\t\t\tWriteWordLine 0 1 \"Edition`t`t`t`t: \" $server.CitrixEdition\r\n\t\t\tWriteWordLine 0 1 \"Version`t`t`t`t: \" $server.CitrixVersion\r\n\t\t\tWriteWordLine 0 1 \"Service Pack`t`t`t: \" $server.CitrixServicePack\r\n\t\t\tWriteWordLine 0 1 \"IP Address`t`t`t: \" $server.IPAddresses\r\n\t\t\tWriteWordLine 0 1 \"Logons`t`t`t`t: \" -NoNewLine\r\n\t\t\tIf($server.LogOnsEnabled)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Enabled\"\r\n\t\t\t} \r\n\t\t\tElse \r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"Disabled\"\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 1 \"Logon Control Mode`t`t: \" -nonewline\r\n\t\t\tSwitch ($Server.LogOnMode)\r\n\t\t\t{\r\n\t\t\t\t\"Unknown\"                       {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\"AllowLogOns\"                   {WriteWordLine 0 0 \"Allow logons and reconnections\"}\r\n\t\t\t\t\"ProhibitNewLogOnsUntilRestart\" {WriteWordLine 0 0 \"Prohibit logons until server restart\"}\r\n\t\t\t\t\"ProhibitNewLogOns \"            {WriteWordLine 0 0 \"Prohibit logons only\"}\r\n\t\t\t\t\"ProhibitLogOns \"               {WriteWordLine 0 0 \"Prohibit logons and reconnections\"}\r\n\t\t\t\tDefault {WriteWordLine 0 0 \"Logon control mode could not be determined: $($Server.LogOnMode)\"}\r\n\t\t\t}\r\n\r\n\t\t\tWriteWordLine 0 1 \"Product Installation Date`t: \" $server.CitrixInstallDate\r\n\t\t\tWriteWordLine 0 1 \"Operating System Version`t: \" $server.OSVersion -NoNewLine\r\n\t\t\tWriteWordLine 0 0 \" \" $server.OSServicePack\r\n\t\t\tWriteWordLine 0 1 \"Zone`t`t`t`t: \" $server.ZoneName\r\n\t\t\tWriteWordLine 0 1 \"Election Preference`t`t: \" -nonewline\r\n\t\t\tSwitch ($server.ElectionPreference)\r\n\t\t\t{\r\n\t\t\t\t\"Unknown\"           {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\"MostPreferred\"     {WriteWordLine 0 0 \"Most Preferred\"; $TotalControllers++}\r\n\t\t\t\t\"Preferred\"         {WriteWordLine 0 0 \"Preferred\"; $TotalControllers++}\r\n\t\t\t\t\"DefaultPreference\" {WriteWordLine 0 0 \"Default Preference\"; $TotalControllers++}\r\n\t\t\t\t\"NotPreferred\"      {WriteWordLine 0 0 \"Not Preferred\"; $TotalControllers++}\r\n\t\t\t\t\"WorkerMode\"        {WriteWordLine 0 0 \"Worker Mode\"; $TotalWorkers++}\r\n\t\t\t\tDefault {WriteWordLine 0 0 \"Server election preference could not be determined: $($server.ElectionPreference)\"}\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 1 \"Folder`t`t`t`t: \" $server.FolderPath\r\n\t\t\tWriteWordLine 0 1 \"Product Installation Path`t: \" $server.CitrixInstallPath\r\n\t\t\tIf($server.LicenseServerName)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"License Server Name`t`t: \" $server.LicenseServerName\r\n\t\t\t\tWriteWordLine 0 1 \"License Server Port`t`t: \" $server.LicenseServerPortNumber\r\n\t\t\t}\r\n\t\t\tIf($server.ICAPortNumber -gt 0)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"ICA Port Number`t`t: \" $server.ICAPortNumber\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 0 \"\"\r\n\r\n\t\t\tIf($SvrOnline -and $Hardware)\r\n\t\t\t{\r\n\t\t\t\tGetComputerWMIInfo $server.ServerName\r\n\t\t\t}\r\n\r\n\t\t\t#applications published to server\r\n\t\t\t$Applications = Get-XAApplication -ServerName $server.ServerName -EA 0 | Sort-Object FolderPath, DisplayName\r\n\t\t\tIf($? -and $Applications)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Published applications:\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing published applications for server $($server.ServerName)\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for server's published applications\"\r\n\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t[int]$Columns = 2\r\n\r\n\t\t\t\tIf($Applications -is [Array])\r\n\t\t\t\t{\r\n\t\t\t\t\t[int]$Rows = $Applications.count + 1\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t[int]$Rows = 2\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t[int]$xRow = 1\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Display name\"\r\n\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Folder path\"\r\n\t\t\t\tForEach($app in $Applications)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing published application $($app.DisplayName)\"\r\n\t\t\t\t\t$xRow++\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $app.DisplayName\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $app.FolderPath\r\n\t\t\t\t}\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove table of published applications to the right\"\r\n\t\t\t\t$Table.Rows.SetLeftIndent(36,1)\r\n\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t#return focus back to document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t#move to the end of the current document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t}\r\n\r\n\t\t\t#get list of applications installed on server\r\n\t\t\t# original work by Shaun Ritchie\r\n\t\t\t# modified by Jeff Wouters\r\n\t\t\t# modified by Webster\r\n\t\t\t# fixed, as usual, by Michael B. Smith\r\n\t\t\tIf($SvrOnline -and $Software)\r\n\t\t\t{\r\n\t\t\t\t#section modified on 3-jan-2014 to add displayversion\r\n\t\t\t\t$InstalledApps = @()\r\n\t\t\t\t$JustApps = @()\r\n\r\n\t\t\t\t#Define the variable to hold the location of Currently Installed Programs\r\n\t\t\t\t$UninstallKey1=\"SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\" \r\n\r\n\t\t\t\t#Create an instance of the Registry Object and open the HKLM base key\r\n\t\t\t\t$reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$Server.ServerName) \r\n\r\n\t\t\t\t#Drill down into the Uninstall key using the OpenSubKey Method\r\n\t\t\t\t$regkey1=$reg.OpenSubKey($UninstallKey1) \r\n\r\n\t\t\t\t#Retrieve an array of string that contain all the subkey names\r\n\t\t\t\tIf($regkey1 -ne $Null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$subkeys1=$regkey1.GetSubKeyNames() \r\n\r\n\t\t\t\t\t#Open each Subkey and use GetValue Method to return the required values for each\r\n\t\t\t\t\tForEach($key in $subkeys1) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$thisKey=$UninstallKey1+\"\\\\\"+$key \r\n\t\t\t\t\t\t$thisSubKey=$reg.OpenSubKey($thisKey) \r\n\t\t\t\t\t\tIf(![String]::IsNullOrEmpty($($thisSubKey.GetValue(\"DisplayName\")))) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$obj = New-Object PSObject\r\n\t\t\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name \"DisplayName\" -Value $($thisSubKey.GetValue(\"DisplayName\"))\r\n\t\t\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name \"DisplayVersion\" -Value $($thisSubKey.GetValue(\"DisplayVersion\"))\r\n\t\t\t\t\t\t\t$InstalledApps += $obj\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\r\n\t\t\t\t$UninstallKey2=\"SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\" \r\n\t\t\t\t$regkey2=$reg.OpenSubKey($UninstallKey2)\r\n\t\t\t\tIf($regkey2 -ne $Null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$subkeys2=$regkey2.GetSubKeyNames()\r\n\r\n\t\t\t\t\tForEach($key in $subkeys2) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$thisKey=$UninstallKey2+\"\\\\\"+$key \r\n\t\t\t\t\t\t$thisSubKey=$reg.OpenSubKey($thisKey) \r\n\t\t\t\t\t\tif(![String]::IsNullOrEmpty($($thisSubKey.GetValue(\"DisplayName\")))) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$obj = New-Object PSObject\r\n\t\t\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name \"DisplayName\" -Value $($thisSubKey.GetValue(\"DisplayName\"))\r\n\t\t\t\t\t\t\t$obj | Add-Member -MemberType NoteProperty -Name \"DisplayVersion\" -Value $($thisSubKey.GetValue(\"DisplayVersion\"))\r\n\t\t\t\t\t\t\t$InstalledApps += $obj\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$InstalledApps = $InstalledApps | Sort DisplayName\r\n\r\n\t\t\t\t$tmp1 = SWExclusions\r\n\t\t\t\tIf($Tmp1 -ne \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$Func = ConvertTo-ScriptBlock $tmp1\r\n\t\t\t\t\t$tempapps = Invoke-Command {&amp; $Func}\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$tempapps = $InstalledApps\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$JustApps = $TempApps | Select DisplayName, DisplayVersion | Sort DisplayName -unique\r\n\r\n\t\t\t\tWriteWordLine 0 1 \"Installed applications:\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing installed applications for server $($server.ServerName)\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for server's installed applications\"\r\n\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t[int]$Rows = $JustApps.count + 1\r\n\r\n\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t[int]$xRow = 1\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Application name\"\r\n\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Application version\"\r\n\t\t\t\tForEach($app in $JustApps)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing installed application $($app.DisplayName)\"\r\n\t\t\t\t\t$xRow++\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $app.DisplayName\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $app.DisplayVersion\r\n\t\t\t\t}\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove table of installed applications to the right\"\r\n\t\t\t\t$Table.Rows.SetLeftIndent(36,1)\r\n\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t#return focus back to document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t#move to the end of the current document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t}\r\n\r\n\t\t\t#list citrix services\r\n\t\t\tIf($SvrOnline)\r\n\t\t\t{\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Citrix services for server $($server.ServerName) by calling Get-Service\"\r\n\t\t\t\t$services = get-service -ComputerName $server.ServerName -EA 0 | where-object {$_.DisplayName -like \"*Citrix*\"} | Sort-Object DisplayName\r\n\t\t\t\tWriteWordLine 0 1 \"Citrix Services\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Citrix services\"\r\n\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t[int]$Rows = $services.count + 1\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tAdd Citrix services table to doc\"\r\n\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t[int]$xRow = 1\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Display Name\"\r\n\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Status\"\r\n\t\t\t\tForEach($Service in $Services)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing Citrix service $($Service.DisplayName)\"\r\n\t\t\t\t\t$xRow++\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $Service.DisplayName\r\n\t\t\t\t\tIf($Service.Status -eq \"Stopped\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorRed\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold  = $True\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Color = $WDColorBlack\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $Service.Status\r\n\t\t\t\t}\r\n\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove table of Citrix services to the right\"\r\n\t\t\t\t$Table.Rows.SetLeftIndent(36,1)\r\n\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t#return focus back to document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t#move to the end of the current document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\r\n\t\t\t\t#Citrix hotfixes installed\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tGet list of Citrix hotfixes installed using Get-XAServerHotfix\"\r\n\t\t\t\t$hotfixes = (Get-XAServerHotfix -ServerName $server.ServerName -EA 0 | Where-Object {$_.Valid -eq $True}) | Sort-Object HotfixName\r\n\t\t\t\tIf($? -and $hotfixes)\r\n\t\t\t\t{\r\n\t\t\t\t\t[int]$Rows = 1\r\n\t\t\t\t\t$Single_Row = (Get-Member -Type Property -Name Length -InputObject $hotfixes -EA 0) -eq $Null\r\n\t\t\t\t\tIf(-not $Single_Row)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$Rows = $Hotfixes.length\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$Rows++\r\n\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tNumber of hotfixes is $($Rows-1)\"\r\n\t\t\t\t\t$HotfixArray = @()\r\n\t\t\t\t\t[bool]$HRP2Installed = $False\r\n\t\t\t\t\t[bool]$HRP3Installed = $False\r\n\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\t\tWriteWordLine 0 1 \"Citrix Installed Hotfixes:\"\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Citrix Hotfixes\"\r\n\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t[int]$Columns = 4\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tAdd Citrix installed hotfix table to doc\"\r\n\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Size = \"10\"\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Hotfix\"\r\n\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Size = \"10\"\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Installed By\"\r\n\t\t\t\t\t$Table.Cell($xRow,3).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t$Table.Cell($xRow,3).Range.Font.Bold = $True\r\n\t\t\t\t\t$Table.Cell($xRow,3).Range.Font.Size = \"10\"\r\n\t\t\t\t\t$Table.Cell($xRow,3).Range.Text = \"Install Date\"\r\n\t\t\t\t\t$Table.Cell($xRow,4).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t$Table.Cell($xRow,4).Range.Font.Bold = $True\r\n\t\t\t\t\t$Table.Cell($xRow,4).Range.Font.Size = \"10\"\r\n\t\t\t\t\t$Table.Cell($xRow,4).Range.Text = \"Type\"\r\n\t\t\t\t\tForEach($hotfix in $hotfixes)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing Citrix hotfix $($hotfix.HotfixName)\"\r\n\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t$HotfixArray += $hotfix.HotfixName\r\n\t\t\t\t\t\tIf($hotfix.HotfixName -eq \"XA650W2K8R2X64R02\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$HRP2Installed = $True\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tIf($hotfix.HotfixName -eq \"XA650W2K8R2X64R03\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$HRP3Installed = $True\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$InstallDate = $hotfix.InstalledOn.ToString()\r\n\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Size = \"10\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $hotfix.HotfixName\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Size = \"10\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $hotfix.InstalledBy\r\n\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Font.Size = \"10\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,3).Range.Text = $InstallDate.SubString(0,$InstallDate.IndexOf(\" \"))\r\n\t\t\t\t\t\t$Table.Cell($xRow,4).Range.Font.Size = \"10\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,4).Range.Text = $hotfix.HotfixType\r\n\t\t\t\t\t}\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove table of Citrix installed hotfixes to the right\"\r\n\t\t\t\t\t$Table.Rows.SetLeftIndent(36,1)\r\n\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\r\n\t\t\t\t\t#compare Citrix hotfixes to recommended Citrix hotfixes from CTX129229\r\n\t\t\t\t\t#hotfix lists are from CTX129229 dated 16-JUL-2013\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCompare Citrix hotfixes to recommended Citrix hotfixes from CTX129229\"\r\n\t\t\t\t\t# as of the 16-JUL-2013 update, there are recommended hotfixes for pre R02 and none for post R02\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Citrix hotfix list for server $($server.ServerName)\"\r\n\t\t\t\t\tIf($HRP3Installed)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$RecommendedList = @()\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElseIf($HRP2Installed)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$RecommendedList = @()\r\n\t\t\t\t\t}\r\n\t\t\t\t\tElse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$RecommendedList = @(\"XA650W2K8R2X64001\",\"XA650W2K8R2X64011\",\"XA650W2K8R2X64019\",\"XA650W2K8R2X64025\",\"XA650R01W2K8R2X64061\", \"XA650W2K8R2X64R02\")\r\n\t\t\t\t\t}\r\n\t\t\t\t\tIf($RecommendedList.count -gt 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Citrix Recommended Hotfixes:\"\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Citrix Hotfixes\"\r\n\t\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t\t\t[int]$Rows = $RecommendedList.count + 1\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tAdd Citrix recommended hotfix table to doc\"\r\n\t\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Citrix Hotfix\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Status\"\r\n\t\t\t\t\t\tForEach($element in $RecommendedList)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing Recommended Citrix hotfix $($element)\"\r\n\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $element\r\n\t\t\t\t\t\t\tIf(!($HotfixArray -contains $element))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t#missing a recommended Citrix hotfix\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorRed\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold  = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Color = $WDColorBlack\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Not Installed\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Installed\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove table of Citrix hotfixes to the right\"\r\n\t\t\t\t\t\t$Table.Rows.SetLeftIndent(36,1)\r\n\t\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\t#build list of installed Microsoft hotfixes\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Microsoft hotfixes for server $($server.ServerName)\"\r\n\t\t\t\t\t[bool]$GotMSHotfixes = $True\r\n\r\n\t\t\t\t\tTry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$results = Get-HotFix -computername $Server.ServerName \r\n\t\t\t\t\t\t$MSInstalledHotfixes = $results | select-object -Expand HotFixID | Sort-Object HotFixID\r\n\t\t\t\t\t\t$results = $Null\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tCatch\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): Get-HotFix failed for $($server.ServerName)\"\r\n\t\t\t\t\t\t$GotMSHotfixes = $False\r\n\t\t\t\t\t\tWrite-Warning \"Get-HotFix failed for $($server.ServerName)\"\r\n\t\t\t\t\t\tWriteWordLine 0 0 \"Get-HotFix failed for $($server.ServerName)\"\r\n\t\t\t\t\t\tWriteWordLine 0 0 \"On $($server.ServerName) you may need to run winmgmt \/verifyrepository and winmgmt \/salvagerepository\"\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tIf($GotMSHotfixes)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tIf($server.OSServicePack.IndexOf('1') -gt 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t#Server 2008 R2 SP1 installed\r\n\t\t\t\t\t\t\t$RecommendedList = @(\"KB2465772\", \"KB2620656\", \"KB2647753\", \"KB2661332\", \r\n\t\t\t\t\t\t\t\t\t\t\t\"KB2728738\", \"KB2748302\", \"KB2775511\", \"KB2778831\",\r\n\t\t\t\t\t\t\t\t\t\t\t\"KB2896256\", \"KB917607\")\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t#Server 2008 R2 without SP1 installed\r\n\t\t\t\t\t\t\t$RecommendedList = @(\"KB2265716\", \"KB2388142\", \"KB2383928\", \"KB2465772\", \r\n\t\t\t\t\t\t\t\t\t\t\t\"KB2620656\", \"KB2647753\", \"KB2661332\", \"KB2728738\", \r\n\t\t\t\t\t\t\t\t\t\t\t\"KB2748302\", \"KB2775511\", \"KB2778831\", \"KB2896256\", \r\n\t\t\t\t\t\t\t\t\t\t\t\"KB917607\", \"KB975777\", \"KB979530\", \"KB980663\", \r\n\t\t\t\t\t\t\t\t\t\t\t\"KB983460\")\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Microsoft Recommended Hotfixes (from CTX129229):\"\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Microsoft Hotfixes\"\r\n\t\t\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t\t\t[int]$Columns = 2\r\n\t\t\t\t\t\t[int]$Rows = $RecommendedList.count + 1\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tAdd Microsoft hotfix table to doc\"\r\n\t\t\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t\t\t[int]$xRow = 1\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Microsoft Hotfix\"\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Status\"\r\n\r\n\t\t\t\t\t\t$results = @{}\r\n\t\t\t\t\t\tForEach($hotfix in $RecommendedList)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$xRow++\r\n\t\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing Microsoft hotfix $($hotfix)\"\r\n\t\t\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $hotfix\r\n\t\t\t\t\t\t\tIf(!($MSInstalledHotfixes -contains $hotfix))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorRed\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold  = $True\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Font.Color = $WDColorBlack\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Not Installed\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tElse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Installed\"\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove table of Microsoft hotfixes to the right\"\r\n\t\t\t\t\t\t$Table.Rows.SetLeftIndent(36,1)\r\n\t\t\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t\t\t#return focus back to document\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t\t\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t\t\t#move to the end of the current document\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t\t\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t\t\t\tWriteWordLine 0 1 \"Not all missing Microsoft hotfixes may be needed for this server `n`tor might already be replaced and not recorded in CTX129229.\"\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t$($server.ServerName) is offline or unreachable.  Citrix Services and Hotfix areas skipped.\"\r\n\t\t\t\tWriteWordLine 0 0 \"Server $($server.ServerName) was offline or unreachable at \"(get-date).ToString()\r\n\t\t\t\tWriteWordLine 0 0 \"The Citrix Services and Hotfix areas were skipped.\"\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 0 \"\" \r\n\t\t\tWrite-Verbose \"$(Get-Date): `tFinished Processing server $($server.ServerName)\"\r\n\t\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 $server.ServerName\r\n\t\t\t$TotalServers++\r\n\t\t}\r\n\t}\r\n}\r\nElse \r\n{\r\n\tWrite-Warning \"Server information could not be retrieved\"\r\n}\r\n$servers = $Null\r\nWrite-Verbose \"$(Get-Date): Finished Processing Servers\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\n#worker groups\r\nWrite-Verbose \"$(Get-Date): Processing Worker Groups\"\r\nWrite-Verbose \"$(Get-Date): `tSetting summary variables\"\r\n[int]$TotalWGByServerName = 0\r\n[int]$TotalWGByServerGroup = 0\r\n[int]$TotalWGByOU = 0\r\n[int]$TotalWGs = 0\r\n\r\nWrite-Verbose \"$(Get-Date): `tRetrieving Worker Groups\"\r\n$WorkerGroups = Get-XAWorkerGroup -EA 0 | Sort-Object WorkerGroupName\r\n\r\nIf($? -and $WorkerGroups -ne $Null)\r\n{\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Worker Groups:\"\r\n\tForEach($WorkerGroup in $WorkerGroups)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Worker Group $($WorkerGroup.WorkerGroupName)\"\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 2 0 $WorkerGroup.WorkerGroupName\r\n\t\t\tIf(![String]::IsNullOrEmpty($WorkerGroup.Description))\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Description: \" $WorkerGroup.Description\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 1 \"Folder Path: \" $WorkerGroup.FolderPath\r\n\t\t\tIf($WorkerGroup.ServerNames)\r\n\t\t\t{\r\n\t\t\t\t$TotalWGByServerName++\r\n\t\t\t\tWriteWordLine 0 1 \"Farm Servers:\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Worker Group by Farm Servers\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Worker Group by Farm Server\"\r\n\t\t\t\t$TempArray = $WorkerGroup.ServerNames | Sort-Object\r\n\t\t\t\tBuildTableForServerOrWG $TempArray\r\n\t\t\t\t$TempArray = $Null\r\n\t\t\t}\r\n\t\t\tIf($WorkerGroup.ServerGroups)\r\n\t\t\t{\r\n\t\t\t\t$TotalWGByServerGroup++\r\n\t\t\t\tWriteWordLine 0 1 \"Server Group Accounts:\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Worker Group by Server Groups\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Worker Group by Server Groups\"\r\n\t\t\t\t$TempArray = $WorkerGroup.ServerGroups | Sort-Object\r\n\t\t\t\tBuildTableForServerOrWG $TempArray\r\n\t\t\t\t$TempArray = $Null\r\n\t\t\t}\r\n\t\t\tIf($WorkerGroup.OUs)\r\n\t\t\t{\r\n\t\t\t\t$TotalWGByOU++\r\n\t\t\t\tWriteWordLine 0 1 \"Organizational Units:\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Worker Group by OUs\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Worker Group by OUs\"\r\n\t\t\t\t$TempArray = $WorkerGroup.OUs | Sort-Object\r\n\t\t\t\tBuildTableForServerOrWG $TempArray\r\n\t\t\t\t$TempArray = $Null\r\n\t\t\t}\r\n\t\t\t#applications published to worker group\r\n\t\t\t$Applications = Get-XAApplication -WorkerGroup $WorkerGroup.WorkerGroupName -EA 0 | Sort-Object FolderPath, DisplayName\r\n\t\t\tIf($? -and $Applications)\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\tWriteWordLine 0 1 \"Published applications:\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing published applications for Worker Group $($WorkerGroup.WorkerGroupName)\"\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tCreate Word Table for Worker Group's published applications\"\r\n\t\t\t\t$TableRange = $doc.Application.Selection.Range\r\n\t\t\t\t[int]$Columns = 2\r\n\r\n\t\t\t\tIf($Applications -is [Array])\r\n\t\t\t\t{\r\n\t\t\t\t\t[int]$Rows = $Applications.count + 1\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t[int]$Rows = 2\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t\t\t\t$table.Style = $myHash.Word_TableGrid\r\n\t\t\t\t$table.Borders.InsideLineStyle = 1\r\n\t\t\t\t$table.Borders.OutsideLineStyle = 1\r\n\t\t\t\t[int]$xRow = 1\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t\t\t\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,1).Range.Text = \"Display name\"\r\n\t\t\t\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t\t\t\t$Table.Cell($xRow,2).Range.Text = \"Folder path\"\r\n\t\t\t\tForEach($app in $Applications)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing published application $($app.DisplayName)\"\r\n\t\t\t\t\t$xRow++\r\n\t\t\t\t\t$Table.Cell($xRow,1).Range.Text = $app.DisplayName\r\n\t\t\t\t\t$Table.Cell($xRow,2).Range.Text = $app.FolderPath\r\n\t\t\t\t}\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove table of published applications to the right\"\r\n\t\t\t\t$Table.Rows.SetLeftIndent(36,1)\r\n\t\t\t\t$table.AutoFitBehavior(1)\r\n\r\n\t\t\t\t#return focus back to document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t\t\t\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t\t\t\t#move to the end of the current document\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t\t\t\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\t\t\t}\r\n\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 $WorkerGroup.WorkerGroupName\r\n\t\t\t$TotalWGs++\r\n\t\t}\r\n\t}\r\n}\r\nElseIf($WorkerGroups -eq $Null)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): There are no Worker Groups created\"\r\n}\r\nElse \r\n{\r\n\tWrite-Warning \"Worker Group information could not be retrieved\"\r\n}\r\n$WorkerGroups = $Null\r\nWrite-Verbose \"$(Get-Date): Finished Processing Worker Groups\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\n#zones\r\nWrite-Verbose \"$(Get-Date): Processing Zones\"\r\nWrite-Verbose \"$(Get-Date): `tSetting summary variables\"\r\n[int]$TotalZones = 0\r\n\r\nWrite-Verbose \"$(Get-Date): `tRetrieving Zones\"\r\n$Zones = Get-XAZone -EA 0 | Sort-Object ZoneName\r\nIf($?)\r\n{\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Zones:\"\r\n\tForEach($Zone in $Zones)\r\n\t{\r\n\t\t$TotalZones++\r\n\t\tWrite-Verbose \"$(Get-Date): `t`tProcessing Zone $($Zone.ZoneName)\"\r\n\t\tIf(!$Summary)\r\n\t\t{\r\n\t\t\tWriteWordLine 2 0 $Zone.ZoneName\r\n\t\t\tWriteWordLine 0 1 \"Current Data Collector: \" $Zone.DataCollector\r\n\t\t\t$Servers = Get-XAServer -ZoneName $Zone.ZoneName -EA 0 | Sort-Object ElectionPreference, ServerName\r\n\t\t\tIf($?)\r\n\t\t\t{\t\t\r\n\t\t\t\tWriteWordLine 0 1 \"Servers in Zone\"\r\n\r\n\t\t\t\tForEach($Server in $Servers)\r\n\t\t\t\t{\r\n\t\t\t\t\tWriteWordLine 0 2 \"Server Name and Preference: \" $server.ServerName -NoNewLine\r\n\t\t\t\t\tWriteWordLine 0 0  \" - \" -nonewline\r\n\t\t\t\t\tSwitch ($server.ElectionPreference)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"Unknown\"           {WriteWordLine 0 0 \"Unknown\"}\r\n\t\t\t\t\t\t\"MostPreferred\"     {WriteWordLine 0 0 \"Most Preferred\"}\r\n\t\t\t\t\t\t\"Preferred\"         {WriteWordLine 0 0 \"Preferred\"}\r\n\t\t\t\t\t\t\"DefaultPreference\" {WriteWordLine 0 0 \"Default Preference\"}\r\n\t\t\t\t\t\t\"NotPreferred\"      {WriteWordLine 0 0 \"Not Preferred\"}\r\n\t\t\t\t\t\t\"WorkerMode\"        {WriteWordLine 0 0 \"Worker Mode\"}\r\n\t\t\t\t\t\tDefault {WriteWordLine 0 0 \"Zone preference could not be determined: $($server.ElectionPreference)\"}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tElse\r\n\t\t\t{\r\n\t\t\t\tWriteWordLine 0 1 \"Unable to enumerate servers in the zone\"\r\n\t\t\t}\r\n\t\t\t$Servers = $Null\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWriteWordLine 0 0 $Zone.ZoneName\r\n\t\t}\r\n\t}\r\n}\r\nElse \r\n{\r\n\tWrite-Warning \"Zone information could not be retrieved\"\r\n}\r\n$Servers = $Null\r\n$Zones = $Null\r\nWrite-Verbose \"$(Get-Date): Finished Processing Zones\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\n[int]$Global:TotalComputerPolicies = 0\r\n[int]$Global:TotalUserPolicies = 0\r\n[int]$Global:TotalIMAPolicies = 0\r\n[int]$Global:TotalADPolicies = 0\r\n[int]$Global:TotalADPoliciesNotProcessed = 0\r\n[int]$Global:TotalPolicies = 0\r\n$ADPoliciesNotProcessed = @()\r\n\r\n#if remoting is enabled, the citrix.grouppolicy.commands module does not work with remoting so skip it\r\nIf($Remoting)\r\n{\r\n\tWrite-Warning \"Remoting is enabled.\"\r\n\tWrite-Warning \"The Citrix.GroupPolicy.Commands module does not work with Remoting.\"\r\n\tWrite-Warning \"Citrix Policy documentation will not take place.\"\r\n}\r\nElse\r\n{\r\n\t#make sure Citrix.GroupPolicy.Commands module is loaded\r\n\tIf(!(Check-LoadedModule \"Citrix.GroupPolicy.Commands\"))\r\n\t{\r\n\t\tWrite-Warning \"The Citrix Group Policy module Citrix.GroupPolicy.Commands.psm1 could not be loaded `nPlease see the Prerequisites section in the ReadMe file (https:\/\/www.dropbox.com\/s\/glq4u2p5xte8s6g\/XA65_Inventory_V4_ReadMe.rtf). `nCitrix Policy documentation will not take place\"\r\n\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t$selection.InsertNewPage()\r\n\t\tWriteWordLine 1 0 \"Policies:\"\r\n\t\tWrite-Verbose \"$(Get-Date): Processing Citrix IMA Policies\"\r\n\t\tWrite-Verbose \"$(Get-Date): `tRetrieving IMA Farm Policies\"\r\n\t\tProcessCitrixPolicies\t\r\n\t\tWrite-Verbose \"$(Get-Date): Finished Processing Citrix IMA Policies\"\r\n\t\tWrite-Verbose \"$(Get-Date): \"\r\n\r\n\t\t#thanks to the Citrix Engineering Team for helping me solve processing Citrix AD based Policies\r\n\t\tWrite-Verbose \"$(Get-Date): See if there are any Citrix AD based policies to process\"\r\n\t\t$CtxGPOArray = @()\r\n\t\t$CtxGPOArray = GetCtxGPOsInAD\r\n\t\tIf($CtxGPOArray -is [Array] -and $CtxGPOArray.Count -gt 0)\r\n\t\t{\r\n\t\t\tWrite-Verbose \"$(Get-Date): There are $($CtxGPOArray.Count) Citrix AD based policies to process\"\r\n\r\n\t\t\t$CtxGPOArray = $CtxGPOArray | Sort\r\n\r\n\t\t\tForEach($CtxGPO in $CtxGPOArray)\r\n\t\t\t{\r\n\t\t\t\tWrite-Verbose \"$(Get-Date): Creating ADGpoDrv PSDrive\"\r\n\t\t\t\tNew-PSDrive -Name ADGpoDrv -PSProvider CitrixGroupPolicy -Root \\ -DomainGpo $($CtxGPO) -Scope \"Global\" | out-null\r\n\t\t\t\tIf(Get-PSDrive ADGpoDrv -EA 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): Processing Citrix AD Policy $($CtxGPO)\"\r\n\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): `tRetrieving AD Policy $($CtxGPO)\"\r\n\t\t\t\t\tProcessCitrixPolicies \"ADGpoDrv\"\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): Finished Processing Citrix AD Policy $($CtxGPO)\"\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t\t\t\t}\r\n\t\t\t\tElse\r\n\t\t\t\t{\r\n\t\t\t\t\t$ADPoliciesNotProcessed += $CtxGPO\r\n\t\t\t\t\t$Global:TotalADPoliciesNotProcessed++\r\n\t\t\t\t\tWrite-Warning \"$($CtxGPO) is not readable by this XenApp 6.5 server\"\r\n\t\t\t\t\tWrite-Warning \"$($CtxGPO) was probably created by an updated Citrix Group Policy Provider\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tIf(!$Summary)\r\n\t\t\t{\r\n\t\t\t\tIf($Global:TotalADPoliciesNotProcessed -gt 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): Processing list of Citrix AD Policies not processed\"\r\n\t\t\t\t\t$ADPoliciesNotProcessed = $ADPoliciesNotProcessed | Sort -unique\r\n\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\t\tWriteWordLine 2 0 \"Active Directory Citrix policies that could not be processed:\"\r\n\t\t\t\t\tForEach($Policy in $ADPoliciesNotProcessed)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tWrite-Verbose \"$(Get-Date): `t Processing skipped Citrix AD policy $($Policy)\"\r\n\t\t\t\t\t\tWriteWordLine 0 1 $Policy\r\n\t\t\t\t\t}\r\n\t\t\t\t\tWrite-Verbose \"$(Get-Date): Finished processing list of Citrix AD Policies not processed\"\r\n\t\t\t\t\tWriteWordLine 0 0 \"\"\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tWrite-Verbose \"$(Get-Date): Finished Processing Citrix AD Policies\"\r\n\t\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\tWrite-Verbose \"$(Get-Date): There are no Citrix AD based policies to process\"\r\n\t\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t\t}\r\n\t\tWrite-Verbose \"$(Get-Date): Finished Processing Citrix Policies\"\r\n\t\tWrite-Verbose \"$(Get-Date): \"\r\n\t}\r\n}\r\n\r\nIf(!$Summary)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Create Appendix A Session Sharing Items\"\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Appendix A - Session Sharing Items from CTX159159\"\r\n\t#\tThe Session Sharing Key is generated by the XML Broker in XenApp 6.5.  \r\n\t#\tWeb Interface or StoreFront send the following information to the XML Broker:\"\r\n\t#\tAudio Quality (Policy Setting)\"\r\n\t#\tClient Printer Port Mapping (Policy Setting)\"\r\n\t#\tClient Printer Spooling (Policy Setting)\"\r\n\t#\tColor Depth (Application Setting)\"\r\n\t#\tCOM Port Mapping (Policy Setting)\"\r\n\t#\tDisplay Size (Application Setting)\"\r\n\t#\tDomain Name (Logon)\"\r\n\t#\tEnableSessionSharing (ICA file or Client Registry Setting)\"\r\n\t#\tEncryption Level (Application Setting and Policy Setting.  Policy wins.)\"\r\n\t#\tFarm Name (Web Interface\/StoreFront)\"\r\n\t#\tSpecial Folder Redirection (Policy Setting)\"\r\n\t#\tTWIDisableSessionSharing(ICA file or Client Registry Setting)\"\r\n\t#\tUser Name (Logon)\"\r\n\t#\tVirtual COM Port Emulation (Policy Setting)\"\r\n\t#\r\n\t#\tThis table consists of the above application settings plus\r\n\t#\tthe application settings from CTX159159\r\n\t#\tColor depth\r\n\t#\tScreen Size\r\n\t#\tAccess Control Filters (for SmartAccess)\r\n\t#\tEncryption\r\n\t#\r\n\t#\tIn addition, a XenApp server can have Session Sharing disable in a registry key\r\n\t#\tTo disable session sharing, the following registry key must be present.\r\n\t#\tThis information has been added to the Server Appendix B section\r\n\t#\r\n\t#\tAdd the following value to disable this feature (this value does not exist by default):\r\n\t#\tHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Citrix\\Wfshell\\TWI\\:\r\n\t#\tType: REG_DWORD\r\n\t#\tValue: SeamlessFlags = 1\r\n\r\n\t$TableRange = $doc.Application.Selection.Range\r\n\t[int]$Columns = 5\r\n\t[int]$Rows = $SessionSharingItems.count + 1\r\n\tWrite-Verbose \"$(Get-Date): `tAdd Session Sharing Items table to doc\"\r\n\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t$table.Style = $myHash.Word_TableGrid\r\n\t$table.Borders.InsideLineStyle = 1\r\n\t$table.Borders.OutsideLineStyle = 1\r\n\t[int]$xRow = 1\r\n\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,1).Range.Text = \"Application Name\"\r\n\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,2).Range.Text = \"Maximum color quality\"\r\n\t$Table.Cell($xRow,3).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,3).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,3).Range.Text = \"Session window size\"\r\n\t$Table.Cell($xRow,4).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,4).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,4).Range.Text = \"Access Control Filters\"\r\n\t$Table.Cell($xRow,5).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,5).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,5).Range.Text = \"Encryption\"\r\n\tForEach($Item in $SessionSharingItems)\r\n\t{\r\n\t\t$xRow++\r\n\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing row for application $($Item.ApplicationName)\"\r\n\t\t$Table.Cell($xRow,1).Range.Text = $Item.ApplicationName\r\n\t\t$Table.Cell($xRow,2).Range.Text = $Item.MaximumColorQuality\r\n\t\t$Table.Cell($xRow,3).Range.Text = $Item.SessionWindowSize\r\n\t\t$Table.Cell($xRow,4).Range.Text = $Item.AccessControlFilters\r\n\t\t$Table.Cell($xRow,5).Range.Text = $Item.Encryption\r\n\t}\r\n\r\n\t$table.AutoFitBehavior(1)\r\n\r\n\t#return focus back to document\r\n\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t#move to the end of the current document\r\n\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\tWrite-Verbose \"$(Get-Date): Finished Create Appendix A - Session Sharing Items\"\r\n\tWrite-Verbose \"$(Get-Date): \"\r\n\r\n\tWrite-Verbose \"$(Get-Date): Create Appendix B Server Major Items\"\r\n\t$selection.InsertNewPage()\r\n\tWriteWordLine 1 0 \"Appendix B - Server Major Items\"\r\n\t$TableRange = $doc.Application.Selection.Range\r\n\t[int]$Columns = 7\r\n\t[int]$Rows = $ServerItems.count + 1\r\n\tWrite-Verbose \"$(Get-Date): `tAdd Major Server Items table to doc\"\r\n\t$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)\r\n\t$table.Style = $myHash.Word_TableGrid\r\n\t$table.Borders.InsideLineStyle = 1\r\n\t$table.Borders.OutsideLineStyle = 1\r\n\t[int]$xRow = 1\r\n\tWrite-Verbose \"$(Get-Date): `t`tFormat first row with column headings\"\r\n\t$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,1).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,1).Range.Text = \"Server Name\"\r\n\t$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,2).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,2).Range.Text = \"Zone Name\"\r\n\t$Table.Cell($xRow,3).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,3).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,3).Range.Text = \"OS Version\"\r\n\t$Table.Cell($xRow,4).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,4).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,4).Range.Text = \"Citrix Version\"\r\n\t$Table.Cell($xRow,5).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,5).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,5).Range.Text = \"Product Edition\"\r\n\t$Table.Cell($xRow,6).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,6).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,6).Range.Text = \"License Server\"\r\n\t$Table.Cell($xRow,7).Shading.BackgroundPatternColor = $wdColorGray15\r\n\t$Table.Cell($xRow,7).Range.Font.Bold = $True\r\n\t$Table.Cell($xRow,7).Range.Text = \"Session Sharing\"\r\n\tForEach($ServerItem in $ServerItems)\r\n\t{\r\n\t\t$xRow++\r\n\t\tWrite-Verbose \"$(Get-Date): `t`t`tProcessing row for server $($ServerItem.ServerName)\"\r\n\t\t$Table.Cell($xRow,1).Range.Text = $ServerItem.ServerName\r\n\t\t$Table.Cell($xRow,2).Range.Text = $ServerItem.ZoneName\r\n\t\t$Table.Cell($xRow,3).Range.Text = $ServerItem.OSVersion\r\n\t\t$Table.Cell($xRow,4).Range.Text = $ServerItem.CitrixVersion\r\n\t\t$Table.Cell($xRow,5).Range.Text = $ServerItem.ProductEdition\r\n\t\tIf([String]::IsNullOrEmpty($ServerItem.LicenseServer))\r\n\t\t{\r\n\t\t\t$Table.Cell($xRow,6).Range.Text = \"Set by policy\"\r\n\t\t}\r\n\t\tElse\r\n\t\t{\r\n\t\t\t$Table.Cell($xRow,6).Range.Text = $ServerItem.LicenseServer\r\n\t\t}\r\n\t\t$Table.Cell($xRow,7).Range.Text = $ServerItem.SessionSharing\r\n\t}\r\n\r\n\t$table.AutoFitBehavior(1)\r\n\r\n\t#return focus back to document\r\n\tWrite-Verbose \"$(Get-Date): `t`tReturn focus back to document\"\r\n\t$doc.ActiveWindow.ActivePane.view.SeekView = $wdSeekMainDocument\r\n\r\n\t#move to the end of the current document\r\n\tWrite-Verbose \"$(Get-Date): `t`tMove to the end of the current document\"\r\n\t$selection.EndKey($wdStory,$wdMove) | Out-Null\r\n\tWrite-Verbose \"$(Get-Date): Finished Create Appendix B - Server Major Items\"\r\n\tWrite-Verbose \"$(Get-Date): \"\r\n}\r\n\r\n#summary page\r\nWrite-Verbose \"$(Get-Date): Create Summary Page\"\r\n$selection.InsertNewPage()\r\nWriteWordLine 1 0 \"Summary Page\"\r\nIf(!$Summary)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): `tAdd administrator summary info\"\r\n\tWriteWordLine 0 0 \"Administrators\"\r\n\tWriteWordLine 0 1 \"Total Full Administrators`t: \" $TotalFullAdmins\r\n\tWriteWordLine 0 1 \"Total View Administrators`t: \" $TotalViewAdmins\r\n\tWriteWordLine 0 1 \"Total Custom Administrators`t: \" $TotalCustomAdmins\r\n\tWriteWordLine 0 2 \"Total Administrators`t: \" ($TotalFullAdmins + $TotalViewAdmins + $TotalCustomAdmins)\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd application summary info\"\r\n\tWriteWordLine 0 0 \"Applications\"\r\n\tWriteWordLine 0 1 \"Total Published Applications`t: \" $TotalPublishedApps\r\n\tWriteWordLine 0 1 \"Total Published Content`t`t: \" $TotalPublishedContent\r\n\tWriteWordLine 0 1 \"Total Published Desktops`t: \" $TotalPublishedDesktops\r\n\tWriteWordLine 0 1 \"Total Streamed Applications`t: \" $TotalStreamedApps\r\n\tWriteWordLine 0 2 \"Total Applications`t: \" ($TotalPublishedApps + $TotalPublishedContent + $TotalPublishedDesktops + $TotalStreamedApps)\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd configuration logging summary info\"\r\n\tWriteWordLine 0 0 \"Configuration Logging\"\r\n\tWriteWordLine 0 1 \"Total Config Log Items`t`t: \" $TotalConfigLogItems \r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd load balancing policies summary info\"\r\n\tWriteWordLine 0 0 \"Load Balancing Policies\"\r\n\tWriteWordLine 0 1 \"Total Load Balancing Policies`t: \" $TotalLBPolicies\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd load evaluator summary info\"\r\n\tWriteWordLine 0 0 \"Load Evaluators\"\r\n\tWriteWordLine 0 1 \"Total Load Evaluators`t`t: \" $TotalLoadEvaluators\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd server summary info\"\r\n\tWriteWordLine 0 0 \"Servers\"\r\n\tWriteWordLine 0 1 \"Total Controllers`t`t: \" $TotalControllers\r\n\tWriteWordLine 0 1 \"Total Workers`t`t`t: \" $TotalWorkers\r\n\tWriteWordLine 0 2 \"Total Servers`t`t: \" ($TotalControllers + $TotalWorkers)\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd worker group summary info\"\r\n\tWriteWordLine 0 0 \"Worker Groups\"\r\n\tWriteWordLine 0 1 \"Total WGs by Server Name`t: \" $TotalWGByServerName\r\n\tWriteWordLine 0 1 \"Total WGs by Server Group`t: \" $TotalWGByServerGroup\r\n\tWriteWordLine 0 1 \"Total WGs by AD Container`t: \" $TotalWGByOU\r\n\tWriteWordLine 0 2 \"Total Worker Groups`t: \" ($TotalWGByServerName + $TotalWGByServerGroup + $TotalWGByOU)\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd zone summary info\"\r\n\tWriteWordLine 0 0 \"Zones\"\r\n\tWriteWordLine 0 1 \"Total Zones`t`t`t: \" $TotalZones\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd policy summary info\"\r\n\tWriteWordLine 0 0 \"Policies\"\r\n\tWriteWordLine 0 1 \"Total Computer Policies`t`t: \" $Global:TotalComputerPolicies\r\n\tWriteWordLine 0 1 \"Total User Policies`t`t: \" $Global:TotalUserPolicies\r\n\tWriteWordLine 0 2 \"Total Policies`t`t: \" ($Global:TotalComputerPolicies + $Global:TotalUserPolicies)\r\n\tWriteWordLine 0 0 \"\"\r\n\tWriteWordLine 0 1 \"IMA Policies`t`t`t: \" $Global:TotalIMAPolicies\r\n\tWriteWordLine 0 1 \"Citrix AD Policies Processed`t: $($Global:TotalADPolicies)`t(AD Policies can contain multiple Citrix policies)\"\r\n\tWriteWordLine 0 1 \"Citrix AD Policies not Processed`t: \" $Global:TotalADPoliciesNotProcessed\r\n}\r\nElse\r\n{\r\n\tWrite-Verbose \"$(Get-Date): `tAdd administrator summary info\"\r\n\tWriteWordLine 0 0 \"Administrators\"\r\n\tWriteWordLine 0 1 \"Total Administrators`t`t: \" $TotalAdmins\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd application summary info\"\r\n\tWriteWordLine 0 0 \"Applications\"\r\n\tWriteWordLine 0 1 \"Total Applications`t`t: \" $TotalApps\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd load balancing policies summary info\"\r\n\tWriteWordLine 0 0 \"Load Balancing Policies\"\r\n\tWriteWordLine 0 1 \"Total Load Balancing Policies`t: \" $TotalLBPolicies\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd load evaluator summary info\"\r\n\tWriteWordLine 0 0 \"Load Evaluators\"\r\n\tWriteWordLine 0 1 \"Total Load Evaluators`t`t: \" $TotalLoadEvaluators\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd server summary info\"\r\n\tWriteWordLine 0 0 \"Servers\"\r\n\tWriteWordLine 0 1 \"Total Servers`t`t`t: \" $TotalServers\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd worker group summary info\"\r\n\tWriteWordLine 0 0 \"Worker Groups\"\r\n\tWriteWordLine 0 1 \"Total Worker Groups`t`t: \" $TotalWGs\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd zone summary info\"\r\n\tWriteWordLine 0 0 \"Zones\"\r\n\tWriteWordLine 0 1 \"Total Zones`t`t`t: \" $TotalZones\r\n\tWriteWordLine 0 0 \"\"\r\n\tWrite-Verbose \"$(Get-Date): `tAdd policy summary info\"\r\n\tWriteWordLine 0 0 \"Policies\"\r\n\tWriteWordLine 0 1 \"IMA Policies`t`t`t: \" $Global:TotalIMAPolicies\r\n\tWriteWordLine 0 1 \"Citrix AD Policies Processed`t: $($Global:TotalADPolicies)`t(AD Policies can contain multiple Citrix policies)\"\r\n\tWriteWordLine 0 1 \"Total Policies`t`t`t: \" $Global:TotalPolicies\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Finished Create Summary Page\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\nWrite-Verbose \"$(Get-Date): Finishing up Word document\"\r\n#end of document processing\r\n#Update document properties\r\n\r\nIf($CoverPagesExist)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Set Cover Page Properties\"\r\n\t_SetDocumentProperty $doc.BuiltInDocumentProperties \"Company\" $CompanyName\r\n\t_SetDocumentProperty $doc.BuiltInDocumentProperties \"Title\" $title\r\n\tIf($Summary)\r\n\t{\r\n\t\t_SetDocumentProperty $doc.BuiltInDocumentProperties \"Subject\" \"XenApp 6.5 Summary Farm Inventory\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t_SetDocumentProperty $doc.BuiltInDocumentProperties \"Subject\" \"XenApp 6.5 Farm Inventory\"\r\n\t}\r\n\t_SetDocumentProperty $doc.BuiltInDocumentProperties \"Author\" $username\r\n\r\n\t#Get the Coverpage XML part\r\n\t$cp = $doc.CustomXMLParts | where {$_.NamespaceURI -match \"coverPageProps$\"}\r\n\r\n\t#get the abstract XML part\r\n\t$ab = $cp.documentelement.ChildNodes | Where {$_.basename -eq \"Abstract\"}\r\n\t#set the text\r\n\t[string]$abstract = \"Citrix XenApp 6.5 Inventory for $CompanyName\"\r\n\t$ab.Text = $abstract\r\n\r\n\t$ab = $cp.documentelement.ChildNodes | Where {$_.basename -eq \"PublishDate\"}\r\n\t#set the text\r\n\t[string]$abstract = (Get-Date -Format d).ToString()\r\n\t$ab.Text = $abstract\r\n\r\n\tWrite-Verbose \"$(Get-Date): Update the Table of Contents\"\r\n\t#update the Table of Contents\r\n\t$doc.TablesOfContents.item(1).Update()\r\n\t$cp = $Null\r\n\t$ab = $Null\r\n\t$abstract = $Null\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Save and Close document and Shutdown Word\"\r\nIf($WordVersion -eq $wdWord2007)\r\n{\r\n\tIf($PDF)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Saving as DOCX file first before saving to PDF\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Saving DOCX file\"\r\n\t}\r\n\tWrite-Verbose \"$(Get-Date): Running Word 2007 and detected operating system $($RunningOS)\"\r\n\tIf($RunningOS.Contains(\"Server 2008 R2\"))\r\n\t{\r\n\t\t$SaveFormat = \"microsoft.office.interop.word.WdSaveFormat\" -as [type] \r\n\t\t$doc.SaveAs($filename1, $SaveFormat)\r\n\t\tIf($PDF)\r\n\t\t{\r\n\t\t\tWrite-Verbose \"$(Get-Date): Now saving as PDF\"\r\n\t\t\t$SaveFormat = $wdSaveFormatPDF\r\n\t\t\t$doc.SaveAs($filename2, $SaveFormat)\r\n\t\t}\r\n\t}\r\n\tElse\r\n\t{\r\n\t\t#works for Server 2008 and Windows 7\r\n\t\t$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], \"wdFormatDocumentDefault\")\r\n\t\t$doc.SaveAs([REF]$filename1, [ref]$SaveFormat)\r\n\t\tIf($PDF)\r\n\t\t{\r\n\t\t\tWrite-Verbose \"$(Get-Date): Now saving as PDF\"\r\n\t\t\t$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], \"wdFormatPDF\")\r\n\t\t\t$doc.SaveAs([REF]$filename2, [ref]$saveFormat)\r\n\t\t}\r\n\t}\r\n}\r\nElse\r\n{\r\n\t#the $saveFormat below passes StrictMode 2\r\n\t#I found this at the following two links\r\n\t#http:\/\/blogs.technet.com\/b\/bshukla\/archive\/2011\/09\/27\/3347395.aspx\r\n\t#http:\/\/msdn.microsoft.com\/en-us\/library\/microsoft.office.interop.word.wdsaveformat(v=office.14).aspx\r\n\tIf($PDF)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Saving as DOCX file first before saving to PDF\"\r\n\t}\r\n\tElse\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Saving DOCX file\"\r\n\t}\r\n\t$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], \"wdFormatDocumentDefault\")\r\n\t$doc.SaveAs([REF]$filename1, [ref]$SaveFormat)\r\n\tIf($PDF)\r\n\t{\r\n\t\tWrite-Verbose \"$(Get-Date): Now saving as PDF\"\r\n\t\t$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], \"wdFormatPDF\")\r\n\t\t$doc.SaveAs([REF]$filename2, [ref]$saveFormat)\r\n\t}\r\n}\r\n\r\nWrite-Verbose \"$(Get-Date): Closing Word\"\r\n$doc.Close()\r\n$Word.Quit()\r\nIf($PDF)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): Deleting $($filename1) since only $($filename2) is needed\"\r\n\tRemove-Item $filename1 -EA 0\r\n}\r\nWrite-Verbose \"$(Get-Date): System Cleanup\"\r\n[System.Runtime.Interopservices.Marshal]::ReleaseComObject($Word) | out-null\r\nRemove-Variable -Name word -Scope Global -EA 0\r\n$SaveFormat = $Null\r\n[gc]::collect() \r\n[gc]::WaitForPendingFinalizers()\r\nWrite-Verbose \"$(Get-Date): Script has completed\"\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\nIf($PDF)\r\n{\r\n\tWrite-Verbose \"$(Get-Date): $($filename2) is ready for use\"\r\n}\r\nElse\r\n{\r\n\tWrite-Verbose \"$(Get-Date): $($filename1) is ready for use\"\r\n}\r\nWrite-Verbose \"$(Get-Date): \"\r\n\r\n#http:\/\/poshtips.com\/measuring-elapsed-time-in-powershell\/\r\nWrite-Verbose \"$(Get-Date): Script started: $($Script:StartTime)\"\r\nWrite-Verbose \"$(Get-Date): Script ended: $(Get-Date)\"\r\n$runtime = $(Get-Date) - $Script:StartTime\r\n$Str = [string]::format(\"{0} days, {1} hours, {2} minutes, {3}.{4} seconds\", `\r\n        $runtime.Days, `\r\n        $runtime.Hours, `\r\n        $runtime.Minutes, `\r\n        $runtime.Seconds,\r\n        $runtime.Milliseconds)\r\nWrite-Verbose \"$(Get-Date): Elapsed time: $($Str)\"\r\n$runtime = $Null\r\n$Str = $Null<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I get this request from time to time, and usually start with this when taking on a new client with Citrix XenApp 6.5. Documenting the current state. This helps me understand what I am going to be taking on, and compare and contrast the configuration over time. In the old days different scripts using mfcom &hellip;<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts\/1205"}],"collection":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1205"}],"version-history":[{"count":2,"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts\/1205\/revisions"}],"predecessor-version":[{"id":1207,"href":"https:\/\/tech-no.org\/index.php?rest_route=\/wp\/v2\/posts\/1205\/revisions\/1207"}],"wp:attachment":[{"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech-no.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}