Jump to content

How to add gruop


JaCro

Recommended Posts

Hi,

I need to add registry entry for adding one group that allow remote desktop connection to windows XP desktop computers. It's only solution for me because we can't use Group Policy... I thought of using batch file as logon script that will add this registry entry locally...

TIA,

JaCro

Link to comment
Share on other sites


If I understand correctly, you want to add a group/user to the "Remote Desktop Users" group?

Dim strPDC

Dim strLocalMachine

Dim strUser

Dim strGroup

strPDC="domain or computername here"

strUser="Group/User here"

strGroup="Remote Desktop Users"

Set objShell = WScript.CreateObject("WScript.Shell")

strLocalMachine = objShell.ExpandEnvironmentStrings("%computername%")

Set oDomain = GetObject("WinNT://" & strLocalMachine)

Set oGroup = oDomain.GetObject("Group", strGroup)

If oGroup.IsMember("WinNT://" & strPDC & "/" & strUser) = False Then

oGroup.Add ("WinNT://" & strPDC & "/" & strUser)

End If

Set oDomain=Nothing

Set oGroup=Nothing

I believe you will have to be logged in with a domain account for this script to work if you are adding a domain group.

Mike Niccum :)

Link to comment
Share on other sites

You're right... I need to add a group from domain to the local group "Remote Desktop Users". But still... does this user must have administrative rights for adding this group to "Remote Desktop Users" group? I want to add this with my logon scipt... Is it possible or not?

Thanks,

JaCro

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...