Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Thursday, 16 May 2013

Windows Groups and Roles - A Peaceful Coexistence

Ah, the dilemmas of enterprise authorization! Groups, or roles, for my permissioning, groups or roles, I query? The two need not be conflicting, necessarily.

Roles have the positive externality of existing outside of Active Directory (AD). Because they are external to AD, they can be flexibly employed to allow authorisation of any system.

They can work together by making membership of the role a group! Then update the group to give everyone in the group that role! Amazing!

A Windows Cloud in the Azure Sky (backed by Solid Data Centers)

Windows Azure has had a lot of publicity of late, as Microsoft's flagship cloud platform, the latest nuance in its PaaS offering (Platform as a Service). In PaaS, the platform provider provides the data center facilities and tools to deploy applications.

Locations of Azure datacenters include San Antonio, Texas (a migration of their Quincy, Washington site), Hong Kong and Dublin, Ireland. A good way to track datacenter activity is the site datacenterknowledge.com.

net group

The Power of net group (a.k.a. net groups)

This command is used to manage groups in Windows domains.

e.g. net group __groupname__ /add

will add the __groupname__ to the domain.

Without parameters, it displays the name of a server and the names of groups on that server.

The Limitation of net groups

However, one should be careful. This command is only used for global groups; there is a corresponding command, net localgroup, for local groups. Note the singular, localgroup, not localgroups.

The nice thing about net localgroup is you don't need to be on a domain controller for this to work. You can run this command on any Windows PC. Some familiar local groups include Administrators and Event Log Readers.

Saturday, 22 November 2008

Multithreaded Server Development in C#

ThreadPools - typically have a maximum number of threads. If all threads are busy, additional tasks are placed in a queue till one thread becomes available. If no threads are available, create a new set of threads to fill the thread pool. Some classes to consider:

ThreadPool - contains a HostProtectionAttribute (introduced in .NET 2.0). Here is some problem code using ThreadPool.

public static void Main() {
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc)); // Queue task
// Thread.Sleep(1000);
Console.WriteLine("Main thread exits."); }

The code above is bad as the program exits before ThreadProc runs (race condition).

WaitCallback - a callback method (delegate) to be called by a thread pool thread
AutoResetEvent - notifies one waiting thread an event has occurred
ManualResetEvent - notifies one or more waiting threads that an event has occurred.

If there are parts of the server you want to code in C++ you can create a C++ DLL using the Win32 Application Wizard. Here are the options you need to set:
  • Select Application Type->DLL and Additional Options->Export Symbols
  • If calling from non-Unicode code, do Project->Properties (ALT-F7), Configuration Properties->General->Character set (set to use multi-byte character set)
  • ALT-f7 -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Libray: “Multi-threaded Debug (/MTd)”. DLL will statically link to the C runtime library. It will increase the size of the DLL but DLL will not be dependent on the correct version of the C runtime library DLL. This is the default anyway.