.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 implement Windows Computer Management using Windows API's

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :.NET Framework
Hi to all! Please guide me since this is really something new to me, and I hope this is the right place to ask these questions.How do I implement Computer Management (Adding computer user to a Group) in C#?Here are the steps that I have done so far using Win API functions and structures:1. For getting the current user's info, I used NetWkstaUserGetInfo to get the current user's user name and log on domain (the structure used is WKSTA_USER_INFO_1) (Ex. user name acquired = user and domain = domain)2. Next is I have to identify whether the current user is a member of the Administrators group by first getting all the members of "Administrators" using NetLocalGroupGetMembers. (the structure used to store each member is LOCALGROUP_MEMBERS_INFO_3). Then looping through the members, I get the corresponding LOCALGROUP_MEMBERS_INFO_3. If the domainAndName member of LOCALGROUP_MEMBERS_INFO_3 is equivalent to the string combining the user name + backslash + domain from Step 1 (Ex. user\domain) then the current user is a member of the "Administrators" group.3. There is a part where I have to check if a certain user is a valid user, just like in Windows, when adding a user to a group. In Windows Computer Management, there is a "Check names" button and the location is identified above. (Example, domain.org). When I type in user1 i

View Complete Post

More Related Resource Links

How to backup SMS from windows mobile Pocket PC to computer

How to backup SMS from windows mobile Pocket PC to computer

Many Windows Mobile Pocket PC Phone users could not backup their SMS to txt file or view on computer. I found this software offers a SMS Messages backup solution to Backup all SMS messages for Windows Mobile Phones onto computer and keep them safe. Here is the user's guide:

Security: Unify Windows Forms and ASP.NET Providers for Credentials Management


The .NET Framework 2.0 provides custom credentials management to ASP.NET apps out of the box. Using it, you can easily authenticate users without using Windows accounts. In this article the author presents a set of helper classes that let a Windows Forms application use the ASP.NET credentials management infrastructure as easily as if it were an ASP.NET application.

Juval Lowy

MSDN Magazine April 2005

Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows


The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

MSDN Magazine March 2004

Resource File: Windows Media 9 Series Digital Rights Management


If you have an application that handles Windows Media content and you need an effective way to track content usage, Windows Media 9 Series now offers Digital Rights Management (DRM). It allows you to take advantage of the peer-to-peer distribution model and still redirect users back to your app once they have downloaded your content (prior to viewing).

MSDN Magazine May 2003

Windows Management Instrumentation: Create WMI Providers to Notify Applications of System Events


Windows Management Instrumentation (WMI) is based on an industry-wide standard for notifications used to manage objects and devices across a network. By receiving WMI events, an application can be notified of changes to data in WMI itself. This allows the developer to notify the consuming application that certain system configuration data has changed, without the application having to poll WMI continuously for this data. The author presents an explanation of the different types of events in WMI, then goes on to develop an event provider.

J. Andrew Schafer

MSDN Magazine September 2001

Windows Management Instrumentation: Administering Windows and Applications across Your Enterprise


This article provides an overview of Windows Management Instrumentation, a technology that exposes a wide variety of system and device information through a standard API. With WMI, management information is exposed by following the object oriented structure outlined in the Common Information Model (CIM), which relies on inheritance for reuse and standardization of object classes that represent system devices. This article briefly describes querying WMI for information using a query language much like SQL called Windows Management Instrumentation Query Language (WQL), existing system classes, handling system events, and security in WMI.

Jeffrey Cooperstein

MSDN Magazine May 2000

Scripting Windows: Windows Management Instrumentation Provides a Powerful Tool for Managing Windows


The new Windows Management Instrumentation (WMI) technology for Windows 2000, Windows NT 4.0, and Windows 98 provides powerful scripting technology that can be used to administrate Windows-based systems. With WMI, you can create scripts to simplify management of devices, user accounts, services, networking, and other aspects of your system. This piece will introduce you to WMI and the WMI Scripting Object Model, taking a look at the available objects, methods, and properties. Along the way, you'll see how these elements can be used to create system management scripts.

Alan Boshier

MSDN Magazine April 2000

MSSQL Management Studio + Windows 7 pro = Problem ?

Hello, My DBA was using Windows XP + MSSQL Management studio 2005 (no SP applied). Everything was fine. Now we upgraded his machine to Windows 7 Pro and MSSQL Management stuio is crazy. We are unable to open 6000 row tables. The program freez and burn 2gigs of memory.   Do I miss something ? SP3 is applied and its still doing nasty things.   MSSQL Stuio Management version : 9.00.4035.00   Thanks !

SQL Server 2008 Management Studio - Summary Windows.

I am using SQL Server 2008 (10.0.1600), now came across an issue to display Summary Windows but unfortunately found that F7 (Keyboard shortcut to display summary window) is not working and even Summary windows is not available in View Menu of SQL Server Management Studio. Maybe it’s a minor issue but I failed to find solution. Thanks (in advance) for the help. 

Management Studio sql 2005 Express on Windows Server 2008 r2

Hi , i have install a application that use sql server express 2005 on a server with OS windows server 2008 r2. My question is how to make automatic backup of my database , because i cant install SQL Server 2005 Management Console on my server .   Please help me Thanks

Error installing SQL Server Management Studio Express on Windows Vista RC1

Hello NG, After installing SQL Server 2005 Express Edition on Windows Vista RC1, I wanted to install also the Managent Studio but I always receive the following error message: "Bei der Installation dieses Pakets ist ein unerwarteter Fehler aufgetreten. Es liegt eventuell ein das Paket betreffendes Problem vor. Der Fehlercode ist 29506." Where can I find more infos about this error-code? Anybody knows this problem? Thank in advance for every help.

Installing SQL Server 2005 management studio express with Windows 7

I have bought a new laptop with windows 7 premium and i cannot install sql server management studio express. I have downloaded sp3 and i still reveive an error message that it is not compatible with the os. please help

VB.NET 2008 - How can i get system/shell icons position (Recycle Bin, My Computer etc) on Windows XP


Please, read this carefully. It is very important.

I already have the working code for all desktop icons position in VB.NET 2008, but it DOES NOT retrieve the systems icons position (like Recycle Bin, My Computer, My Documents etc), ONLY for the operating system Windows XP 32bit. This vb.net code works perfectly well and get the systems icons position, on Windows XP 64bit, Windows Vista and Windows 7.

So, the only problem that I have with this VB.NET 2008 code, is that it's NOT retrieving the system icons position, only on XP 32bit.

Can anyone help me ? I really need help, as I can't figure this out by myself.


Here is the VB.NET 2008 code:


Imports System.Runtime.InteropServices

Module mdlDesktopIcons

    Private Const STANDARD_RIGHTS_REQUIRED As Integer = &HF0000
    Private Const SECTION_QUERY As Integer = &H1S
    Private Const SECTION_MAP_WRITE As Integer = &H2S
    Private Const SECTION_MAP_READ As Integer = &H4S
    Private Const SECTION_MAP_EXECUTE As Integer = &H8S
    Private Const SECTION_EXTEND_SIZE As Integer = &H10S
    Private Const SECTI

Cannot connect to a configuration database after renaming Windows 7 computer


I have just recently installed a standalone instance of SharePoint 2010 on Windows 7 64-bit.  Everything was working fine, however, as part of joining my computer to the domain, my computer was renamed.  Now that the computer has been renamed, I am no longer able to connect to my locally installed SharePoint instance.  I receive an error message stating "Cannot connect to the configuration database."

I found this article on renaming a server for SharePoint Foundation: http://technet.microsoft.com/en-us/library/cc288510.aspx.  However, it seems like the article is assuming that the rename operation occurred while SharePoint was still running.  However, I am running SharePoint Portal Server 2010 and now that I cannot connect to the configuration database, I cannot make any alterations to the SharePoint instance at all.

In addition, my instance of SQL Server as well as the standalone SharePoint instance was installed prior to the computer rename.  What are the steps that are required to address this situation?


my 64 bit computer, windows 7 OS, won't load and run microsoft visual studio 2008



i'm in school and am trying to load and run my downloaded microsoft visual studio 2008 program, and my computer won't let me sighting, incompatability with 64 bit versions of windows. please contact the vedor to see if a 64 bit compatible version is available.

please help!!!



Error Installing Sql Management Studio 2008 on 64 Bit Windows 7


I am getting the following message when I try to install SQL Management Studio on a 64 bit Windows 7 Premium Dell Laptop.  

The message is: Sqlserver 2008 Setup requires Microsoft .net Framework 3.5 SP1 to be installed.

I have downloaded the Service pack and attempted to install as Adminstrator  (Dotnetfx35setup.exe).   It comes up and asks if I want to run it, but nothing ever loads.     I don't know if a registry setting is conflicting with the installation or what.

This computer came with Vista Home Premium 64bit and we installed the upgrade to Windows 7 Home Premium 64bit (in case this has something to do with it.)   I have 2008 SQL Express running without problem along with Visual Studio 2008.

Any advice or suggestions to try would be appreciated.

David Parham

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