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