Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Need to add a username to a remote machines Terminal and remote desktop.

Hi,

Need to add a username to a remote machines Terminal and remote desktop.

REgards
Sharath
Avatar of Speshalyst
Speshalyst
Flag of India image

can you explain more what you want to do....thanks....
Avatar of bsharath

ASKER

In the Gpedit > Computer Configuration > Windows Settings > Local Policy > User Rights >
You have many options so in there > Allow log on through Terminal Services and Allow log on locally inside these 2 security settings if i need to add a user remotely.Is there a way...
Any help....
it is better to use it using group policy in domain. you can access the GP setting from same path and apply this GPO.
I am using the script like this...

strComputer = "dev-chen-mrd100"
Set objGroup = GetObject("WinNT://" & strComputer & "/Allow log on locally")
Set objUser = GetObject("WinNT://" & strComputer & "development/enoch")
objGroup.Add(objUser.ADsPath)


But get this error.

---------------------------
Windows Script Host
---------------------------
Script:      C:\Add user to terminal services.vbs
Line:      2
Char:      1
Error:      The group name could not be found.
Code:      800708AC
Source:       (null)

---------------------------
OK  
---------------------------
is the "Allow log on locally" group exist on "dev-chen-mrd100"

you should use


strComputer = "dev-chen-mrd100"
Set objGroup = GetObject("WinNT://" & strComputer & "/Remote Desktop Users")
Set objUser = GetObject("WinNT://domainname/username")
objGroup.Add(objUser.ADsPath)

chaneg domainname and username as per requirement
mailtosinghs

I think i got you wrong.As i mentioned i need to add users to the below mentioned path remotely.

In the Gpedit > Computer Configuration > Windows Settings > Local Policy > User Rights >
You have many options so in there > Allow log on through Terminal Services and Allow log on locally inside these 2 security settings if i need to add a user remotely.Is there a way...
ASKER CERTIFIED SOLUTION
Avatar of mailtosinghs
mailtosinghs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial