Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Script to add permissions to RDP-Tcp connection

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,32777
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Script to add permissions to RDP-Tcp connection
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Script to add permissions to RDP-Tcp connection - 3/28/2006 7:40:36 AM   
  manu4u007

 

Posts: 8
Score: 0
Joined: 3/20/2006
Status: offline
Hi all,
      I have 150 terminal servers and want to add a specific user to the RDP-TCP Permissions.
Terminal Server Configuration->Connection settings->RDP-TCP-> Properties->Permissions.
I was able to do it for the 2003 Terminal servers and the script works fine for the 2003 terminal server but not for 2000.

Below is the script that i am using . any ideas how do i implement the same for 2000 Terminal servers.

set RDPObj = GetObject("winmgmts:{impersonationLevel=impersonate}!Win32_TSPermissionsSetting.TerminalName='RDP-Tcp'")
RDPobj.AddAccount "Domain\User", X

Where "Domain\User", X:




Domain\User: Target Domain and Account (user or group) to which permissions are to be granted.


X: The type of access to be granted:
0 = WINSTATION_GUEST_ACCESS
1 = WINSTATION_USER_ACCESS
2 = WINSTATION_ALL_ACCESS
http://support.microsoft.com/?kbid=290720

Any response would be highly appreciated.
Thanks
Manu

 
 
Post #: 1
 
 RE: Script to add permissions to RDP-Tcp connection - 3/29/2006 8:01:04 AM   
  ziminski

 

Posts: 79
Score: 2
Joined: 1/8/2006
Status: offline
Does the command line utility work on win2000?

At a command prompt, type wmic. Note: If it is not in the path, add %SystemRoot%\System32\Wbem\, or change to that directory and run wmic.
2. At the wmic:root\cli> prompt, type the following command:
PATH WIN32_TSPermissionsSetting.TerminalName="RDP-TCP" call AddAccount "Domain\user",X

If so can you call it from the run or exec methods?

(in reply to manu4u007)
 
 
Post #: 2
 
 RE: Script to add permissions to RDP-Tcp connection - 4/5/2006 5:38:35 AM   
  manu4u007

 

Posts: 8
Score: 0
Joined: 3/20/2006
Status: offline
Hi,
  Sorry for replying late. No it does not runs from the run command as well neither from the cmd prmt.
it works on 2003 terminal server though..

Regards
Manu

(in reply to ziminski)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Script to add permissions to RDP-Tcp connection Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts