Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help needed in creating TS CAP

28 views
Skip to first unread message

zulfekhar Mohammed Sabry@discussions.microsoft.com Shaik zulfekhar Mohammed Sabry

unread,
Oct 31, 2008, 6:10:01 AM10/31/08
to
Hi all,
I am trying to automate the Terminal Services installation.
I installed Terminal Services by executing Servermanagercmd.exe command on
Windows Powershell.
I am using WMI class to configure the environment. As a part of
configuring the environment,
I need to create Terminal Services Connection Authorization Policy (TS
CAP)for TS gateway server. To do this, we have “Create Method of the
Win32_TSGatewayConnectionAuthorizationPolicy Class”.

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

Bjorn Mereboer

unread,
Jan 12, 2009, 10:22:01 AM1/12/09
to
I'm wondering if someone has an solution for this problem, because we have
the same problem.

Kind regards,

Bjorn Mereboer

cory...@gmail.com

unread,
Dec 17, 2013, 11:24:25 AM12/17/13
to
I was just running into the same problem and found the solution, so I thought I'd share in case you haven't already figured this out.

Since the Create method of the Win32_TSGatewayConnectionAuthorizationPolicy is a static method, you need to use the [wmiclass] type accelerator. Try this:

([wmiclass]"\\.\root\CIMV2\TerminalServices:Win32_TSGatewayConnectionAuthorizationPolicy").Create("TS_CAP_01","RDPELEDOMAIN\Domain Users","RDPELEDOMAIN\Domain Users",0,1,0,1,2,1,1,1,1,1)
0 new messages