Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I locked my self out by inadvertently changing RDP firewall rule to use IPSec,but without completing proper steps to setup IPSec channel from my laptop to server.

Luckily all wmi remoting on Server works,So I am trying to edit the rule with Powershell

When I enter below code ,the COM object is invoking on local machine.How can I invoke it on remote machine?

Enter-PSSession $Session
$fw = New-Object -ComObject hnetcfg.fwpolicy2
share|improve this question

1 Answer 1

up vote 1 down vote accepted

I did some more digging around web and and found that to activate remote com object via remoting we need to use

$fw = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{304CE942-6E39-40D8-943A-B913C40C9CD4}",$ServerName))

Unfortunately, in my case this didn't work either as it need remote activation of COM objects to be enabled on server,which I didn't.

However ,I changed tracks and used Invoke Command to ship the code for local execution on server and managed to fix it as mentioned in this link.

https://gist.github.com/2181246

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.