Add Current User to Remote Desktop Users Group
Log In or Register to download the BES file, and more.

1 Votes

Description

Thiis task will add the currently logged in user to the remote desktop users group.

Property Details

ID3794
StatusQA - Ready for Production Level Testing
TitleAdd Current User to Remote Desktop Users Group
DomainBESC
SourceInternal
Source Release Date6/11/2014 12:00:00 AM
KeywordsAdd Current User to Remote Desktop Users
Added by on 6/11/2014 8:44:48 AM
Last Modified by on 6/11/2014 8:44:48 AM
Counters 3132 Views / 13 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

isWindows (Relevance 1172)
Used in 1119 fixlets and 527 analyses   * Results in a true/false
Show indented relevance
windows of operating system
Used in 1 fixlet   * Results in a true/false
Show indented relevance
exist current user and not (exists member whose (it as string as lowercase ends with (name of current user)) of local group "Remote Desktop Users" )

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
parameter "User" = "{(value "LastLoggedOnUser" of (key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" of native registry) as string)}"

createfile until ENDOFSCRIPT
Dim localGroupName, ADUserName, strComputer, objLocalGroup, objADUser
strComputer = "."

'''Parse the command line arguments (if it exists)
If Wscript.Arguments.Count < 2 then
Err.Raise 1, "Invalid argument", "Missing parameters"
Else
ADUserName = Wscript.Arguments.Item(0)
localGroupName = Wscript.Arguments.Item(1)
End If
ADUserName = REPLACE(ADUserName, "\", "/")

Set objLocalGroup = GetObject("WinNT://" & strComputer & "/" & localGroupName & ",group")
Set objUser = GetObject("WinNT://" & ADUserName & ",user")

objLocalGroup.Add(objUser.ADsPath)
wscript.echo "Successfully added " & ADUserName & " to " & localGroupName
ENDOFSCRIPT

delete AddUserToLocalGroup.vbs
copy __createfile AddUserToLocalGroup.vbs

waithidden cscript.exe AddUserToLocalGroup.vbs "{parameter "User"}" "Remote Desktop Users"
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!
Petramonicker -
Question: How do you add a specific domain user to the Remote Desktop Users group?