-
Using My Citrix PVS PowerShell Documentation Script with Remoting
March 15, 2013
I needed to figure out how to run my latest PVS documentation script without having Microsoft Word installed on the PVS server. This turned out to be much simpler than I thought it would be. There are only four steps involved.
- From the computer to run the script, start a PowerShell session as Administrator
- Add-PSSnapin McliPSSnapin
- Mcli-Run SetupConnection -p Server=PVSServerName
- .\PVS_Inventory_V2.ps1 -verbose
The results of my session on my Windows 7 VM against my Windows Server 2008 R2 PVS 6.1 server VM:
PS C:\webster> $env:computername WIN7 PS C:\webster> Add-PSSnapin McliPSSnapin PS C:\webster> Mcli-Run SetupConnection -p Server=PVS61 Run succeeded. PS C:\webster> .\PVS_Inventory_V2.ps1 -verbose VERBOSE: checking for McliPSSnapin VERBOSE: Getting PVS version info VERBOSE: Build PVS farm values VERBOSE: Setting up Word VERBOSE: Create Word comObject. If you are not running Word 2007, ignore the next message. VERBOSE: The object written to the pipeline is an instance of the type "Microsoft.Office.Interop.Word.ApplicationClass" from the component's primary interop assembly. If this type exposes different members than the IDispatch members, scripts written to work with this object might not work if the primary interop assembly is not installed. VERBOSE: Running Microsoft Word 2010 VERBOSE: Validate company name VERBOSE: Validate cover page VERBOSE: Company Name: Webster's Lab VERBOSE: Cover Page : Motion VERBOSE: User Name : administrator VERBOSE: Farm Name : PVS61Farm VERBOSE: Title : Inventory Report for the PVS61Farm Farm VERBOSE: Filename : C:\webster\PVS61Farm.docx VERBOSE: Load Word Templates VERBOSE: Create empty word doc VERBOSE: disable spell checking VERBOSE: insert new page, getting ready for table of contents VERBOSE: table of contents VERBOSE: set the footer VERBOSE: get the footer and format font VERBOSE: Footer text VERBOSE: add page numbering VERBOSE: return focus to main document VERBOSE: move to the end of the current document VERBOSE: Processing PVS Farm Information VERBOSE: Processing Security Tab VERBOSE: Processing Groups Tab VERBOSE: Processing Licensing Tab VERBOSE: Processing Options Tab VERBOSE: Processing vDisk Version Tab VERBOSE: Processing Status Tab VERBOSE: Processing Sites VERBOSE: Processing Site PVS61Site VERBOSE: Processing Security Tab VERBOSE: Processing Options Tab VERBOSE: Processing vDisk Update Tab VERBOSE: Processing Servers in Site PVS61Site VERBOSE: Processing Server PVS61 VERBOSE: Processing General Tab VERBOSE: Processing Network Tab VERBOSE: Processing Stores Tab VERBOSE: Processing Stores for server VERBOSE: Processing Store Store VERBOSE: Processing Options Tab VERBOSE: Processing Logging Tab VERBOSE: Processing Server Tab on Advanced button VERBOSE: Processing Network Tab on Advanced button VERBOSE: Processing Pacing Tab on Advanced button VERBOSE: Processing Device Tab on Advanced button VERBOSE: Processing Bootstrap files VERBOSE: Processing Bootstrap files for Server PVS61 VERBOSE: Processing General Tab VERBOSE: Processing Options Tab VERBOSE: Processing all vDisks in site VERBOSE: Processing vDisk Update Management VERBOSE: Processing all device collections in site VERBOSE: Processing Collection PVS61Collection VERBOSE: Processing General Tab VERBOSE: Processing Security Tab VERBOSE: Processing Auto-Add Tab VERBOSE: Processing each collection process for each device VERBOSE: Processing all site views in site VERBOSE: Processing all PVS Farm Views VERBOSE: Processing Stores VERBOSE: Processing Store Store VERBOSE: Processing General Tab VERBOSE: Processing Servers Tab VERBOSE: Processing Server PVS61 VERBOSE: Processing Paths Tab VERBOSE: Finishing up Word document VERBOSE: Set Cover Page Properties VERBOSE: Update the Table of Contents VERBOSE: Save and Close document and Shutdown Word PS C:\webster>
That is it, that is all there is to it.
Hope this help.
Webster
8 Responses to “Using My Citrix PVS PowerShell Documentation Script with Remoting”
Leave a Reply
December 17, 2015 at 10:11 am
Hi Carl,
trying to run this script, but I’m getting this error. Any ideas?
Mcli-Run : Could not load file or assembly ‘CDFNet, Version=7.1.0.4022, Culture=neutral, PublicKeyToken=null’ or one
of its dependencies. The system cannot find the file specified.
Chris
PS. uber noob to PS…
December 17, 2015 at 10:13 am
Did you read the ReadMe that came with the script? If not, it has the prereqs for running the script in it.
Webster
December 17, 2015 at 10:47 am
Carl,
I’m missing something. I registered the McliPSSnapin on my PC that I am trying to run the script from, no error there, but I’m still getting the same error
December 17, 2015 at 11:09 am
If you are running 64-bit Windows, did you register both the 32bit and 64bit DLLs?
Webster
August 3, 2013 at 6:04 am
Carl/Fred: why not simply check if the wfica32.exe process is running (remotely)?
June 20, 2013 at 12:43 pm
Newbie PS user here, is there any way that I can sweep with powershell script a set of PCs and check if they have an active citrix ica connection/session (12.x). I don’t have access to the back-end, but would help me check on sessions that need to always be on certain PCs.
Thanks for any feedback or tips.
Fred
August 2, 2013 at 10:47 am
I personally do not know how to do that. Maybe someone reading this can help you.
Webster
August 2, 2013 at 11:11 am
John Carthy on Twitter responded:
“im no PoSH expert but if he can use PSremoting to run netstat -an | findstr :1494, then that would likely be an ica connection”