Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
Windows Vista GroupsView
Windows Vista Administration_Accounts_Passwords
Windows Vista File_Management
Windows Vista Games
Windows Vista General
Windows Vista Hardware_Devices
Windows Vista Installation_Setup
Windows Vista Mail
Windows Vista Music_Pictures_Video
Windows Vista Networking_Sharing
Windows Vista Performance_Maintenance
Windows Vista Security
Windows Vista Hardware_Assessment

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Apps
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft Windows Vista Security Posts  Ask A New Question 

Determining an administrator on Vista

A posted on Tuesday, February 03, 2009 3:46 PM

I am using the techinque to get the TokenElevationType using the API
GetTokenInformation on Vista to determine if a user is an admin. It seems to
work fine on Vista Business/Ultimate etc. However, it fails on Vista Home.
Does anyone have any clues?

The code is along the following lines:

TOKEN_ELEVATION_TYPE elevationType;
DWORD dwSize;

GetTokenInformation(hUserToken, TokenElevationType, &elevationType,
sizeof(elevationType), &dwSize);

switch (elevationType)
{
case TokenElevationTypeDefault:
TRACE(_T("TokenElevationTypeDefault - User is not using a split token\n"));
m_bAdmin = FALSE;
break;

case TokenElevationTypeFull:
TRACE(_T("TokenElevationTypeFull - User has a split token, and the
process is running elevated\n"));
m_bAdmin = TRUE;
break;

case TokenElevationTypeLimited:
TRACE(_T("TokenElevationTypeLimited - User has a split token, but the
process is not running elevated\n"));
m_bAdmin = TRUE;
break;

}

Thanks.
reply

 

First, when posting questions about a function that returns potential errors,

Sam Hobbs posted on Wednesday, February 04, 2009 3:02 PM

First, when posting questions about a function that returns potential
errors, include the error code. This function returns an error code that is
obtained by GetLastError. If you have not used GetLastError for this then if
you do use it for this you might have an answer. If the error code does not
immediately tell you what the problem is then search for GetTokenInformation
with the error code. You might need to convert the error code to a symbolic
name; look in winerror.h to do that. Or you might need to search the error
code with a "0x" prefix. Search the MSDN, and if that does not help, search
the Windows programming security group (Google groups might help) and if
that does not help search the internet.

Second, any time a question says something such as "doesn't work" or
I describe above.

Finally, this is not a programming group. You should ask in the Windows
programming security group.
reply

How about this instead.

SuperXero posted on Wednesday, February 04, 2009 3:57 PM

How about this instead. Right Click on my computer, click manage, local
users and groups, users, right click, properties, member of. If they are
in the administrators group they are an admin.

SuperXero
*'HackingManual.Net' (http://hackingmanual.net)*


--
SuperXero
reply

You obviously are clueless about what I asked.

A posted on Wednesday, February 04, 2009 4:05 PM

You obviously are clueless about what I asked. If you do not know, that is
fine but please do not waste everyone's time by responding with useless
messages.
reply

Determining an administrator on Vista

Mark H posted on Wednesday, February 04, 2009 4:25 PM

http://www.developmentnow.com/groups/post.aspx?newsgroupid=21&threadid=851943

http://blogs.msdn.com/cjacks/archive/2006/10/09/How-to-Determine-if-a-User-is-a-Member-of-the-Administrators-Group-with-UAC-Enabled-on-Windows-Vista.aspx


If that doesn't answer it, contact Wang. (e-mail at end of post, first link)

to
token\n"));
reply

Determining an administrator on Vista

FromTheRafters posted on Wednesday, February 04, 2009 5:11 PM

http://blogs.msdn.com/cjacks/archive/2006/10/09/How-to-Determine-if-a-User-is-a-Member-of-the-Administrators-Group-with-UAC-Enabled-on-Windows-Vista.aspx

Maybe these guys can be more help.
reply

So do you think this is a programmer's group?

Sam Hobbs posted on Wednesday, February 04, 2009 8:20 PM

So do you think this is a programmer's group?

The answer I gave is typical of answers given in the MSDN forums. It is very
normal for people in a programmer's forum to ask for details of "fails"; in
particular what does GetLastError return when it is relevant. If this
question were responded to by a Microsoft person, they would certainly ask
for that.

What in particular do you consider incorrect?
reply

Al (the person asking the question) needs to do it in a program.

Sam Hobbs posted on Wednesday, February 04, 2009 8:29 PM

Al (the person asking the question) needs to do it in a program. If I am
incorrect about that then the source code is misleading. In programming
forums, when someone provides source code, they cannot use a "manual"
(non-automated) solution.
reply

I get it sam, like if a program needs to validate someone as admin ornot admin.

SuperXero posted on Wednesday, February 04, 2009 10:38 PM

I get it sam, like if a program needs to validate someone as admin or
not admin. Yep I am not a programmer just a network admin.


--
SuperXero
reply

Yes, there you go; there are many reasons that might be done.

Sam Hobbs posted on Thursday, February 05, 2009 12:14 PM

Yes, there you go; there are many reasons that might be done. Generally it
would be useful for issuing a message informing someone they need to have
Administrator privileges when they don't, instead of letting them proceed
and then get a more obscure crash message.
reply

 
 

Previous Microsoft Windows Vista Security conversation.