Click here to Skip to main content
15,797,062 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: status of printer on network............... Pin
SandipG 16-Oct-08 21:54
SandipG 16-Oct-08 21:54 
GeneralRe: status of printer on network............... Pin
ani_ikram16-Oct-08 22:02
ani_ikram16-Oct-08 22:02 
QuestionRe: status of printer on network............... Pin
David Crow17-Oct-08 4:58
David Crow17-Oct-08 4:58 
QuestionRegarding Admin rights user Pin
H4u3216-Oct-08 21:13
H4u3216-Oct-08 21:13 
QuestionRe: Regarding Admin rights user Pin
David Crow17-Oct-08 5:00
David Crow17-Oct-08 5:00 
AnswerRe: Regarding Admin rights user Pin
H4u3217-Oct-08 5:50
H4u3217-Oct-08 5:50 
GeneralRe: Regarding Admin rights user Pin
Michael Dunn17-Oct-08 12:22
sitebuilderMichael Dunn17-Oct-08 12:22 
GeneralRe: Regarding Admin rights user Pin
H4u3217-Oct-08 20:26
H4u3217-Oct-08 20:26 
void ChangeUserPrivilege(LPWSTR csUser, DWORD csPrivilege)
{
NET_API_STATUS nStatus;

USER_INFO_1 ui1005;
DWORD dwLevel1005 = 1005;
DWORD dwPrivilege = 0;;

wchar_t *pswzUser = csUser;

if(csPrivilege == 2) dwPrivilege = USER_PRIV_USER;

ui1005.usri1_priv = dwPrivilege;
nStatus = NetUserSetInfo(NULL,pswzUser,dwLevel1005,(LPBYTE)&ui1005,NULL);

if(nStatus != NERR_Success)
// MessageBox(hwnd, (LPCWSTR)"Failed", (LPCWSTR)"Test", NULL);
fprintf(stderr, "NetUserGetinfo failed with error: %d\n", nStatus);
}

I am using above code to change admin rights user to limited rights user. Is it possible with this code.

Thanks
QuestionFunction to get the local system Administrator Name Pin
Taruni16-Oct-08 19:33
Taruni16-Oct-08 19:33 
AnswerRe: Function to get the local system Administrator Name Pin
Naveen16-Oct-08 19:46
Naveen16-Oct-08 19:46 
GeneralRe: Function to get the local system Administrator Name Pin
Taruni16-Oct-08 20:04
Taruni16-Oct-08 20:04 
GeneralRe: Function to get the local system Administrator Name Pin
Naveen16-Oct-08 20:10
Naveen16-Oct-08 20:10 
GeneralRe: Function to get the local system Administrator Name Pin
Taruni16-Oct-08 20:20
Taruni16-Oct-08 20:20 
GeneralRe: Function to get the local system Administrator Name Pin
Naveen16-Oct-08 20:42
Naveen16-Oct-08 20:42 
GeneralRe: Function to get the local system Administrator Name Pin
Taruni16-Oct-08 21:00
Taruni16-Oct-08 21:00 
QuestionRe: Function to get the local system Administrator Name Pin
David Crow17-Oct-08 5:02
David Crow17-Oct-08 5:02 
AnswerRe: Function to get the local system Administrator Name Pin
enhzflep16-Oct-08 19:58
enhzflep16-Oct-08 19:58 
QuestionHow can I remove an item in Combo box's list box ? Pin
SherTeks16-Oct-08 19:18
SherTeks16-Oct-08 19:18 
AnswerRe: How can I remove an item in Combo box's list box ? Pin
AlexAbramov16-Oct-08 20:59
AlexAbramov16-Oct-08 20:59 
QuestionI need help figuring this out please Pin
LilKoopa16-Oct-08 19:05
LilKoopa16-Oct-08 19:05 
AnswerRe: I need help figuring this out please Pin
User 21559716-Oct-08 19:36
User 21559716-Oct-08 19:36 
GeneralRe: I need help figuring this out please Pin
LilKoopa17-Oct-08 8:51
LilKoopa17-Oct-08 8:51 
AnswerRe: I need help figuring this out please Pin
David Crow17-Oct-08 9:52
David Crow17-Oct-08 9:52 
QuestionInterface Design Question Pin
mombawomba16-Oct-08 17:08
mombawomba16-Oct-08 17:08 
AnswerRe: Interface Design Question Pin
Graham Shanks17-Oct-08 0:43
Graham Shanks17-Oct-08 0:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.