tags:

views:

35

answers:

1

Is there anyway to give a newly created user from NetUserAdd() remote desktop access and/or administrative rights? I know it is possible, at least for Remote Desktop, and I have been reading through the MSDN but nothing seems to hint at what is required to be set for it to work.

A: 

Those rights are controlled by alias membership. For Remote Desktop access it's the Remote Desktop Users alias, while for administrators it's the Administrators alias (obviously). You can add users to aliases using NetLocalGroupAddMembers.

PS: The proper term is "alias", but the Net* functions use "local group" for some reason.

EDIT: If you have trouble using "Administrators" or "Remote Desktop Users", try "Builtin\Administrators" and "Builtin\Remote Desktop Users".

wj32