[ActiveDir] RDP Script

2006-04-19 Thread Adeel Ansari



AD Gurus, 

I am trying to create a script that adds TS accounts for W2K AD domain. 
I have tried eolwtscom and wts_admin.dll with no luck. 

Iam lookingforsomething like this below but this one 
only works in 2003 server. 

http://www.microsoft.com/technet/scriptcenter/scripts/ts/users/tsusvb01.mspx

"Const GUEST_ACCESS = 0 

strComputer = "." Set objWMIService = GetObject("winmgmts:" _ 
  "{impersonationLevel=impersonate}!\\"  
strComputer  "\root\cimv2") 

Set colItems = objWMIService.ExecQuery _  
("Select * from Win32_TSPermissionsSetting") 

For Each objItem in colItems  errResult = 
objItem.AddAccount("fabrikam\bob", GUEST_ACCESS) Next" 

Can someone please help? Adeel


Re: [ActiveDir] RDP Script

2006-04-19 Thread Teo De Las Heras
Would this help?
http://marcusoh.blogspot.com/2006/04/misc-enabling-terminal-services.html#links

Teo
On 4/19/06, Adeel Ansari [EMAIL PROTECTED] wrote:


AD Gurus, 

I am trying to create a script that adds TS accounts for W2K AD domain. I have tried eolwtscom and wts_admin.dll with no luck. 

Iam lookingforsomething like this below but this one only works in 2003 server. 

http://www.microsoft.com/technet/scriptcenter/scripts/ts/users/tsusvb01.mspx


Const GUEST_ACCESS = 0 

strComputer = . Set objWMIService = GetObject(winmgmts: _   {impersonationLevel=impersonate}!\\  strComputer  \root\cimv2) 

Set colItems = objWMIService.ExecQuery _  (Select * from Win32_TSPermissionsSetting) 

For Each objItem in colItems  errResult = objItem.AddAccount(fabrikam\bob, GUEST_ACCESS) Next 

Can someone please help? Adeel