Avatar of davesnb
davesnb
Flag for Canada asked on

new-object -comobject

Hello EE,

I had a script runing under 2003 server and  powershell using the below com object , however when i run the getstatistics nothing comes back , the object is registered and the Egilh.ComTracker shows in the com object list . Is there a way to get this working under the 2012 64bit whcih I am running now?

$tracker = new-object -comobject Egilh.ComTracker
$trackerlist = [xml]($tracker.getstatistics())

Open in new window



 Get-ChildItem HKLM:\Software\Classes -ErrorAction SilentlyContinue | Where-Object {
   $_.PSChildName -match '^\w+\.\w+$' -and (Test-Path -Path "$($_.PSPath)\CLSID")
} | Select-Object -ExpandProperty PSChildName

Open in new window

PowershellWindows Server 2012

Avatar of undefined
Last Comment
Qlemo

8/22/2022 - Mon
Qlemo

Do you get anything?
new-object -comobject Egilh.ComTracker | gm

Open in new window

davesnb

ASKER
No, that was my first line of code  . Blank result
SOLUTION
Qlemo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
davesnb

ASKER
OK It works when I run the 32 bit powershell version . However, in my case I have a script that runs on a powershell ssh session , so I need to force the script to run as 32bit . Is there a way to include something at the beginning of the script to run using 32bit powershell?
Your help has saved me hundreds of hours of internet surfing.
fblack61
Qlemo

How do you connect exactly? When creating a remote PS session via WinRM you can provide a session configuration created for that purpose of making sure you run on 32bit.
davesnb

ASKER
I connect using "powershell server " it runs as a service . So when I connect , it connects to the native shell, which in this case is 64 bit .
ASKER CERTIFIED SOLUTION
Qlemo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.