Virtualization, technology, and random rantings with a focus on Citrix and VMware.

Category: PowerShell

Trying To Tie It Together

Wow! Two posts in one day!? What is that!?

So… I’m working on getting this completed. What you may ask? I’m working on powershelling myself into some quick reference materials. I haven’t seen many things that help tie a published application back to a machine. I’m working on one that will get the last missing pieces. Right now, this ties the machine to the application with the users assigned to it. This only shows who is assigned to the applications and what machine it is running on. The next iteration will hopefully tie in the assignments made at the Delivery Group level.

Enter-PSSession servername
asnp citrix*
get-brokermachine | select catalogname,hostedmachinename, @{N="publishedapplications";e={$($_.publishedapplications -join ',')}}, @{N="AssociatedUserNames";e={$($_.AssociatedUserNames -join ',')}} | export-csv c:\software\allapps.csv -NoTypeInformation -append
exit-pssession

This will get you the machine catalog, the hosting machine, published applications, and the users assigned to it. Sometimes a quick glance to find where an application is running is helpful. You still have to parse the CSV for what you need, but it is all in one place. Let’s see if we can make it slightly better the next time around. Maybe make a winform with some buttons that show it in text areas. We shall see!

Assistance on getting this working goes to Stuart. Check out his blog!

Something Mandatory This Way Comes….

 

So, you have found that you have the dreaded, evil, painful, Mandatory Upgrade message…. This has happened to me a few times. I’ve spoken with Citrix support (which was very good about this btw) to get fixed a couple of times. The third time, I tried my hand at re-creating the sorcery that was shown to me. I pulled a Sorceror’s Apprentice fail for a bit. After arguing with my hand against my forehead and maybe some choice angry words of frustration dipped in a rainbow of expression, I finally got it. I got the order of operations right. I got the thingie to come back to me without resorting to percussive maintenance. That would be quite difficult since they are virtual. It would’ve been as effective as a flame-proof candle. But, I share with you below what I did to bring it back from the dreaded error….

 

Go ahead and close Studio and log out at that point. You need the account that was used to build the farm. I tried other accounts, and they just didn’t have the power. This account also needed SA on the SQL server to register all the instances. So that is what I found prerequisite. Then, open some sweet, sweet Powershell ISE as administrator.  Copy and paste this into the ISE. Run the first two lines to see the count of instances. There should be 60 per controller for 7.15LTSR. There is one line commented out. Run that line and only that line on ONE controller, otherwise you are starting the process over again. Once you run it on the first controller, comment it back out and run that beautiful bean footage from “Get-Service Citrix* | Stop-Service -Force” onward. You will have to repeat the process sans the commented out line on the rest of the Delivery Controllers.

 

asnp Citrix*

Get-ConfigRegisteredServiceInstance | measure

Get-Service Citrix* | Stop-Service -Force
Get-Service Citrix* | Start-Service

#Get-ConfigRegisteredServiceInstance | Unregister-ConfigRegisteredServiceInstance

Get-AdminServiceInstance | register-configserviceInstance
Get-AcctServiceInstance | register-configserviceInstance
Get-ApplibServiceInstance | register-configserviceInstance
Get-BrokerServiceInstance | register-configserviceInstance
Get-ConfigRegisteredServiceInstance | register-configserviceInstance
Get-ConfigServiceInstance | register-configserviceInstance
Get-EnvTestServiceInstance | register-configserviceInstance
Get-HypServiceInstance | register-configserviceInstance
Get-LogServiceInstance | register-configserviceInstance
Get-MonitorServiceInstance | register-configserviceInstance
Get-ProvServiceInstance | register-configserviceInstance
Get-SfServiceInstance | register-configserviceInstance
Get-TrustServiceInstance | register-configserviceInstance
Get-OrchServiceInstance | register-configserviceInstance

Get-ConfigRegisteredServiceInstance -servicetype config | Reset-AdminServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-AcctServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-ApplibServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-BrokerServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-ConfigServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-EnvTestServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-HypServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-LogServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-MonitorServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-ProvServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-SfServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-TrustServiceGroupMembership
Get-ConfigRegisteredServiceInstance -servicetype config | Reset-OrchServiceGroupMembership

 

After you run this, you should be able to run the “Get-ConfigRegisteredServiceInstance | measure” command again to see the proper number of instances. You can run this after you run the above on a controller and see if the number increments properly. Sometimes you have to reboot the Controller after doing the fix. If you have 4 Delivery Controllers, it will look like below:

 

You should be able to open Studio now and it looks all pretty and pristine!

Let me know if this helps you out! Tune in for next blog’s episode, “Something, Something, Something Dark Side.”

 

 

 

 

 

PoSh Spice Be Here!

I want to take a moment… Ok, that moment’s over. Bringing to you from the world of powershell, powercli, and power scripting….. Stuart Yerdon, and the webmaster of https://notesofascripter.com. He has been featured as a vExpert, a connoisseur of all things M:TG (If you have to ask….), and a colleague and friend of mine. Check out his site and all things powershell. If you got a problem, and you can find him (you can at https://notesofascripter.com), you’ll find what you seek.

Page 5 of 5

Powered by WordPress & Theme by Anders Norén