Solved

I need an automated way to add users to the "Remote Desktop Users"-group.

Posted on 2009-07-13
3
661 Views
Last Modified: 2013-11-10
I need an automated way to add users to the "Remote Desktop Users"-group of 10 pc's.
I have an account that has administrative privileges on these pc's and want to add them easily.
0
Comment
Question by:itbabe
  • 2
3 Comments
 
LVL 7

Expert Comment

by:ManicD
ID: 24839118
C:\>net group /?
The syntax of this command is:


NET GROUP
[groupname [/COMMENT:"text"]] [/DOMAIN]
          groupname {/ADD [/COMMENT:"text"] | /DELETE}  [/DOMAIN
          groupname username [...] {/ADD | /DELETE} [/DOMAIN]


thus you need the command

net group Group_Name User_name /add
0
 
LVL 7

Expert Comment

by:ManicD
ID: 24839126
Sorry, forgot to credit my link

http://www.ss64.com/nt/net_useradmin.html
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 24840265

If you had a list of computer names in a text file you could do something like this in PowerShell...

$User = "WinNT://yourdomain/username"

Get-Content "ComputerList.txt" | %{
  $LocalGroup = [ADSI]"WinNT://$_/Remote Desktop Users"
  $LocalGroup.Add($User)
}

Chris
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A brief introduction to what I consider to be the best editor for PowerShell.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

730 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