But when I am trying to use it from powershell I am getting the below error:
PS C:\Users\Administrator>
$myretvalcap=$myobjcap.Create("TS_CAP_01","RDPELEDOMAIN\Domain
Users","RDPELEDOMAIN\Domain Users",0,1,0,1,2,1,1,1,1,1)
Method invocation failed because
[System.Management.ManagementObject#root\cimv2\TerminalServices\Win32_TSGatewayConnect
ionAuthorizationPolicy] doesn't contain a method named 'Create'.
At line:1 char:30
+ $myretvalcap=$myobjcap.Create <<<< ("TS_CAP_01","RDPELEDOMAIN\Domain
Users","RDPELEDOMAIN\Domain Users",0,1,0,1,2,1,1
,1,1,1)
To confirm that the current setup is not the cause, I created the Connection
Authorization Policy manually using the wizard. I was able to retrieve policy
related information using powershell command.
Then I tried to retrieve the methods that this class supports, I found that
the list does not contain Create()method.
Can you please let me know an alternate way to create connection
authorization policy (TS CAP) in case Create() method is not available. I can
not go for manaul approach as my target is to automate this.
Any pointers in resolving the issue would be of great help.
Thanks,
Sabry
Kind regards,
Bjorn Mereboer