header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Powershell and Citrix
Last Post 21 Aug 2008 12:57 PM by SynJunkie. 9 Replies.
Printer Friendly
Sort:
NextNext
You are not authorized to post a reply.
Author Messages
SynJunkieUser is Offline
New Member
New Member
Posts:83

--
13 Aug 2008 01:36 PM  

Hi,

I'm attempting to use Powershell to pull some interesting information from my citrix farm.  I have been trying to do this from my workstation using Brandon Shells citrix scripts.  I have not had much luck at all and I'm wondering if anyone know whether I should be running these scripts in Powershell from a citrix server rather than from a workstation.

Thanks

Lee

 

 

bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
13 Aug 2008 02:52 PM  
Check http://bsonposh.com/archives/345
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
13 Aug 2008 02:53 PM  
As long as that is setup properly you can do either local or remote.
meson3902User is Offline
New Member
New Member
Posts:10

--
13 Aug 2008 05:24 PM  

What are the issues that you are encountering?

 

SynJunkieUser is Offline
New Member
New Member
Posts:83

--
14 Aug 2008 03:26 PM  

Brandon,  I had read your article and checked impersonation on DCOM on a citrix server which was configured correctly.

 

I copied your script into a file called ctx-run.ps1 and after running the error I got was:

New-Object : Cannot load COM type MetaframeCOM.MetaFrameFarm.
At C:\ctx-run.ps1:1 char:21
+ $mfFarm = New-object  <<<< -com "MetaframeCOM.MetaFrameFarm"
You cannot call a method on a null-valued expression.
At C:\ctx-run.ps1:2 char:19
+ $mfFarm.Initialize( <<<< 1)
Get-Member : No object has been specified to get-member.
At C:\ctx-run.ps1:4 char:13
+ $mfFarm | gm  <<<< # all the properties are there, but blank

 

I'm guessing there is something very basic that I am doing wrong but I'm unsure what it is.

 

meson3902User is Offline
New Member
New Member
Posts:10

--
14 Aug 2008 03:28 PM  

Did you install the Citrix Presentation Server SDK on your workstation?

Mark

 

SynJunkieUser is Offline
New Member
New Member
Posts:83

--
14 Aug 2008 03:40 PM  

ahh..... now that looks better.

 

Thanks for the help.

bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
14 Aug 2008 03:59 PM  
The impersonation is a client thing not a server thing (unless you are using the server as the client)
SynJunkieUser is Offline
New Member
New Member
Posts:83

--
14 Aug 2008 04:32 PM  

Ok, that helps.  I can query a server in the farm that I specify when I installed the SDK but I never get anything back from querying the farm when i run scripts looking to list applications such as:

 

# Farm Stuff

$Farm = New-object -com "MetaframeCOM.MetaFrameFarm"
$Farm.Initialize(1)

$Farm.FarmName
#$farm | Get-Member -type Properties
$farm.Applications


# Server Stuff

$mfsrv = New-Object -ComObject MetaFrameCOM.MetaFrameServer
$mfsrv.Initialize(6,$ENV:ComputerName)
#$mfsrv | Get-Member -type Properties
$mfsrv.Sessions | ft Servername,Username,AppName,ClientAddress -auto

 

Maybe i'll reboot my PC after ammending the dcom settings as per your posts directions.

 

Thanks

SynJunkieUser is Offline
New Member
New Member
Posts:83

--
21 Aug 2008 12:57 PM  

I didn't really get to much further into this but I did find that using PowerGUI allowed me to run scripts that interacted with my citrix farm well.  Maybe this is a layer 8 problem, i'll revisit it when I get a bit more of a handle on the basics.

 

Thanks all for your help.

 

Lee

You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer