.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to check if a given user is local admin or not

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :.NET Framework
Hi, How to check if a user (may be domain user also) is part of local administrators group or not? Note I am NOT talking about checking of current logged in user. I should send the username & passowrd of any user (may or may not be domain user) & that should flag me whether that user is local admin or not. Please help.

View Complete Post

More Related Resource Links

How to authenticate local user usin ldap or non domain authentication



I created one application, and I need to authenticate local user. This user is the user who is login to his/her Personal Computer.. Main thing his that he/she does not in any DOMAIN... I want NON-DOMAIN authentication.. any how.... please help...

How To Check if user is already logged to another computer..???

By the way.,, I am new here.... I  am doing a little vb.net windows form project but connected with the internet ... question : how can I check if the user is already login to another computer..??   somebody here please.. ideas.. thanks..... : )    

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appl

Hi ,From the last few days I am struggling with the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."I hav created an asp.net web application with membership shcema. It works fine an my developement machine but when I published it on my web server. It is giving me above error for which I searched but not found any help.Can anyone help me with this.

How to determine if current SQL User is admin or owner?

I wish to determine, from my C# application, if the current user has admin or owner rights to the database they are connected to. I beleive I have all the information required: Servername Database name Windows/Database auth username (If database auth) password (if database auth) I'm trying to find a way that using the smo objects (smo.user), but as of yet I cant quite work it out: - How to get the appropriate user - How to determine if that user is an admin/owner. Any tips would be appreciated. If I have posted to the wrong forum, let me know - I couldnt find one that was obviously more appropriate. Thanks.

How to check effective permissions for a user or group for a SQL server object or whole server?

Guys, How do I see effective permissions for a user or group for a SQL server object or whole server? For example, a user is not listed in security/logins, but he is a member of few groups and some of them have assigned permissions on SQL server (again either directly or through membership in other groups) Even when I select an object (a table), check properties/permission – it doesn’t let me select any principal, except those listed on security/logins… Anyway, what is the right way to see effective permissions for a user or group? Sorry for asking such a simple question, I’ve searched but found nothing relevant.

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appl

Hi,I spend two days looking for an anwser to this problem but no luck. I have a simple ASP.NET 2.0 application which run correctly on my local machine. But After uploading all files including web.config file on a Windows 2003 Server with SQLEXPRESS installed. I have this error. Please Help!!!!!! Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appl

Hello everybody.I am working on Login control and I am new in ASP.NET. So far what I did is :1. In Website->ASP.NET Configuration I change the form authentication to internet.2. I created a user profile3. This gave me a ASPNETDB.mdf database.4. I added this code :<connectionStrings> <remove name="LocalSqlServer" /> <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> </connectionStrings> in web.config file.4. I added login control to my login page :<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="Untitled Page" %><asp:Content ID="MainContent" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server"> <h1>Please Login</h1> <asp:Login ID="LoginAuth" runat="server" > </asp:Login></asp:Content> 5. And the login.aspx.cs file has :using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.W

How to let a non admin business user run a replication snapshot job?

According to the msdn library, I would have to give the non admin user (User1) SQLAgentUserRole privileges. But it also says that it has to be a local job and not a multi server job. Is the snapshot agent job a local or multi server job? Considering the snapshot agent is a local job and i make USER1 the owner of that job. He should be able to run the job rite? I need to give USER1 the ability to run sp_start_job to start the snapshot agent ONLY! (and not any other jobs). So what are the steps to do this? I also read that the only way to achieve this is by creating a proxy account? Is there an article somewhere that best describes this?  

check user exists in which group

After entering user name, i want check user belonging to which group, group is some thing like role based if group is something group1 , then i want redirect hime to page 1, if groupis 2  then page 2 like that

The specified user account "domain\username" is a local account. Local accounts should only be used

HI Im getting this error when trying to set a new Service account for my performance point services. SharePoint is installed in a single server enviroment. I can´t get a new service account configured and I think this is causing my server to run slowly. Any help would be highly appreciated thanks

SQL Error with Login: Login failed for user 'NT AUTHORITY\SYSTEM'. [CLIENT: ]

<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {mso-style-noshow:yes; mso-style-priority:99; color:purple; mso-themecolor:followedhyperlink; text-decoration:underline; text-underline:single;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page Section1 {size:612.0pt 792.0pt; margin:70.85pt 3.0cm 70.85pt 3.0cm; mso-header-m

Create user account for web authentication from non-web/local application

Hi, I have an application which is installed on local pc and is using SQL db. It is a client management system where I want to add capability to register new clients and give them access to my web site which is sharing the same SQL database with local application. At the moment clients can register on the web site and I have ASP.NET authorisation system set up with aspnetdb_user, aspnetdb_membership and etc tables. But sometimes it happens that I need to register clients on my local application on PC and ideally would like that registration to create online account for the client as well. Then I want to be able to send him user id and password by email and let him know that he has been registered in my database and online account is ready for him as well. Basically I want to have full synchronization between asp.net membership service and local application through SQL db. As I said both online and local apps are shareing the same SQL database. I would like to know if it is possible at all and what would be the best practice to implement it. Thank you.  

How to add colleagues to a user profile without admin priviliges programatically ...

Hi,I am working on a kind of a social networking site and the use case is as follows.1. User A sends a friendship request to User B.2. User B accepts.3. User A is added as a colleague in User B's Profile.4. User B is added as a colleague in User A's Profile.Step 2-4 are done using User B's login. Step 2 and 3 go fine but in step 4 I get the following error "This operation requires you to be managing your own data or have administrator privileges.". The API being used is UserProfile.Colleagues.Create (...);What is required is obvious but not possible in this scenario. SPSecurity.RunWithElevatedPrivileges does not help.  Any other way of accomplishing this.Thanks.

Document is read-only in SharePoint, but user sees "check out" option in Office 2007 / Word / Excel

I am finding that when there is a document library in SharePoint with checkin/checkout required, if a user with read-only ("Visitor") permissions opens a document from that library, the document will open as read-only in Word, Excel, etc., but the user will see the "Server Document" bar with the message "To modify this document, you must check it out" and the "check out" button.  When the user tries to check the document out, they are asked to authenticate, and then receive the error "Cannot perform this operation.  The file has been deleted or someone else has it checked out."    How is it possible to prevent a user with read-only rights in SharePoint from seeing the "Check out" option in Word or Excel?

Check user and pass at login

Hello!I use a class method that looks something like this to check for user and pass at login:public static bool checkUser(string conn, string user, string pass) { SqlConnection conn = new SqlConnection(conn); string sql = "SELECT User, Pass FROM TableUser WHERE User = @user AND Pass = @pass"; SqlDataAdapter da = new SqlDataAdapter(sql, conn); SqlParameter daUser = da.SelectCommand.Parameters.Add("@user", SqlDbType.NVarChar); SqlParameter daPass = da.SelectCommand.Parameters.Add("@pass", SqlDbType.NVarChar); daUser.Value = user; daPass.Value = pass; conn.Open(); DataSet ds1 = new DataSet(); da.Fill(ds1, "tbl"); int i = ds1.Tables["tbl"].Rows.Count; conn.Close(); if (i == 1) return true; else return false; }...and I just wanted to ask, if there is a shorter/faster way (the user table is on an SQL Server? Also is this way secure?Note: I set the collation for the password field on the SQL Server to be case sensitive so I don't have to account for it in the code.Thx!M

Alerts - 1 user fails with "PermissionMask check failed. asking for 0x00000055, have 0x3C4312EF", ot

I have set Alerts for 3 users on a Document Library in our Team Site in a MOSS 2007 environment.  Alerts go out for every other person I set alerts for, with the exception of this person.  Our Exchange Admin tracked down the Alert email and saw that while everyone else was listed, this person was not.  At the same time I turned on Verbose logging for the log files and found the PermissionMask failure.  The problem is I cannot figure out why this person is failing this check. This person happens to be a member of our IT team, as are the other people I added Alerts for.  I should also note that this problem occurs whether I add the alert for this person, or this person adds the alert themselves.  I have checked the permissions on the Library and they are inherited from the Site level.  When I check the permissions on the Site level, the IT team has Contribute permissions, I did then check the AD Security Group to be sure that this person is in the group, and they are. Any ideas as to why this would happen for this person only?  This person can access, and add content, to the Library which puzzles me more.  My next test will be to add this permission to the Site permissions explicity with Full Control to see if that matters. In Googling for this, I find a number of PermissionMask posts, but none that seem to address this specific pro
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend