JaCro Posted May 12, 2004 Share Posted May 12, 2004 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 More sharing options...
mniccum Posted May 12, 2004 Share Posted May 12, 2004 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=NothingI 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 More sharing options...
JaCro Posted May 13, 2004 Author Share Posted May 13, 2004 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now