[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VBScript to add domain user to the computer’s RDC user list

Posted on 2012-09-11
6
Medium Priority
?
1,093 Views
Last Modified: 2012-09-13
Dear Experts:

I have a VBScript to add domain user to the computer’s RDC user list. See below.
Set objGroup = GetObject("WinNT://Win7-64-1.domain1.org/remote Desktop users,group")
Set objUser = GetObject("WinNT://domain1.org/user1,user")
objGroup.Add (objUser.ADsPath)

When the user and computer in the same domain, it is fine.
When the user and computer in the different domains though there is two-way trust between the domains, it does not work. However, I can add it manually.

Set objGroup = GetObject("WinNT://Win7-64-1.domain1.org/remote Desktop users,group")
Set objUser = GetObject("WinNT://domain2.org/user2,user")
objGroup.Add (objUser.ADsPath)

I am running on Windows AD server 2008 R2 environment.

Do you have any advices?
Thanks a lot!
0
Comment
Question by:CRIIT
  • 3
  • 3
6 Comments
 
LVL 7

Expert Comment

by:rsimsee
ID: 38388375
Are you getting any kind of error message when it fails?  The question is whether or not it can't find the domain, or whether or not it gets an access denied when accessing it...
0
 

Author Comment

by:CRIIT
ID: 38388712
Thanks for your reply. You are right. I need to get some message from there.

I added Err = objGroup.Add (objUser.ADsPath)
to get the Err = 1A8 (424) Do you any ideas for that?
Thanks!
0
 
LVL 7

Expert Comment

by:rsimsee
ID: 38388728
I did a quick search and came up with this:

"A 424 error is a 'object required' error being thrown from within xyz.vbs."

So it sounds like it needs another parameter in order to work correctly.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:CRIIT
ID: 38391055
Yeah, the error means that username dose not exist in the Active Directory.
But, I build the two-ways trust between the domains and I can add the user manually.
Is there any parameters that I can add on the "objGroup.Add (objUser.ADsPath)"?
I didn't find the syntax for that.
Another solution, is there the powershell script for that function?
Thanks,
0
 
LVL 7

Accepted Solution

by:
rsimsee earned 2000 total points
ID: 38391151
0
 

Author Closing Comment

by:CRIIT
ID: 38396100
Thanks, rsimsee
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question