Regarding Admin rights user
-
I am making Win32 application. My need is to determine whether current user has administrative rights or not. Also i need to check how many account exist on system with administrative rights. If no any account exist then create one with administrative rights. Any help would be greatly appreciated. Thanks hemang
-
I am making Win32 application. My need is to determine whether current user has administrative rights or not. Also i need to check how many account exist on system with administrative rights. If no any account exist then create one with administrative rights. Any help would be greatly appreciated. Thanks hemang
Hemang Raval wrote:
My need is to determine whether current user has administrative rights or not.
Hemang Raval wrote:
If no any account exist then create one with administrative rights.
Windows will have at least one administrative account.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Hemang Raval wrote:
My need is to determine whether current user has administrative rights or not.
Hemang Raval wrote:
If no any account exist then create one with administrative rights.
Windows will have at least one administrative account.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Thanks for reply. Now How would i know about the number of accounts with administrative rights. I want to create another if there exist only one admin account. BTW, thanks for previous reply. i hope for positive reply for this question also Regards, Hemang
Look at NetUserEnum()[^] and NetUserGetInfo()[^].
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Look at NetUserEnum()[^] and NetUserGetInfo()[^].
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
Thanks a lot again. I tried to use NetUserEnum. But it gives me the information about every account created on a machine. My requirement is to get only number of accounts and its information which are having administrator rights. Thanks in advance. Please help me out. Thanks Hemang
-
Thanks a lot again. I tried to use NetUserEnum. But it gives me the information about every account created on a machine. My requirement is to get only number of accounts and its information which are having administrator rights. Thanks in advance. Please help me out. Thanks Hemang
Hemang Raval wrote:
My requirement is to get only number of accounts and its information which are having administrator rights.
#1) There is nothing like GetNumberOfAccounts(). However, it should be easy to count the number of accounts yourself with the information NetUserEnum() provides. #2) For finding if an account has administrative rights, you can use NetUserGetInfo(), which I suggested in my previous post itself.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
Hemang Raval wrote:
My requirement is to get only number of accounts and its information which are having administrator rights.
#1) There is nothing like GetNumberOfAccounts(). However, it should be easy to count the number of accounts yourself with the information NetUserEnum() provides. #2) For finding if an account has administrative rights, you can use NetUserGetInfo(), which I suggested in my previous post itself.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
-
A bunch of thanks. I got a clue from your answer and also found solution for getting number of admin account from NetGetUserInfo. Thanks a lot again. Regards, Hemang
Hemang Raval wrote:
Thanks a lot again.
Glad to be of service. :)
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]