Regarding Admin rights user
-
Hi all, My reqirement is to change admin rights user to limited account user. I tried to change admin rights to limited user account using NetUserSetInfo(). But wasnt succeeded in that. so please help me out in this scenario. How would I accomplish it?? Any help would be greatly appreciated. Thanks. Hemang
-
Hi all, My reqirement is to change admin rights user to limited account user. I tried to change admin rights to limited user account using NetUserSetInfo(). But wasnt succeeded in that. so please help me out in this scenario. How would I accomplish it?? Any help would be greatly appreciated. Thanks. Hemang
Hemang Raval wrote:
I tried to change admin rights to limited user account using NetUserSetInfo(). But wasnt succeeded in that.
What did
NetUserSetInfo()
return?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Hemang Raval wrote:
I tried to change admin rights to limited user account using NetUserSetInfo(). But wasnt succeeded in that.
What did
NetUserSetInfo()
return?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
It has returned error code 87. Having been referred to MSDN, i came to know that this error code indicates that one of the functions parameter is invalid. But i am not having an idea about which parameter i am passing wrong. Any clue?? Your help would be greatly appreciated. Thanks Hemang
-
It has returned error code 87. Having been referred to MSDN, i came to know that this error code indicates that one of the functions parameter is invalid. But i am not having an idea about which parameter i am passing wrong. Any clue?? Your help would be greatly appreciated. Thanks Hemang
Post your code.
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen
-
Post your code.
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen
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