Scott Hanselman

Finding out the name of the EVERYONE Group on a non-english (International) version of Windows

July 21, '03 Comments [1] Posted in Web Services | Internationalization
Sponsored By

I preach a lot about awareness around issues of Internationalization.  Issues arise when we make assumptions.  For example, if you have code that assumes the security group "Everyone" is called "Everyone" on a non-english Windows box...well, you can guess that "results are not guaranteed."

Typically (in C++/SDK) you don't refer to these groups by name, but rather by SID.  Depending on what you're doing, there's a number of ways to figure these things out.  Perhaps instead of using “Everyone,” use the Everyone SID: (S-1–1–0)

You may want to call AllocateAndInitializeSid...see Creating Security Descriptor and most importantly the list of Well-Known SIDs.

Call AllocateAndInitializeSid to obtain the SID of the Everyone group. In the parameters passed to AllocateAndInitializeSid, the number of subauthorities in the SID is set to 1, and the value of the first subauthority is set to SECURITY_WORLD_RID.

PSID BuildEveryoneSid() {
   SID_IDENTIFIER_AUTHORITY auth = SECURITY_WORLD_SID_AUTHORITY;
   PSID pSID = NULL;
   BOOL fSuccess = AllocateAndInitializeSid(&auth, 1,
      SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pSID);
   return(fSuccess ? pSID : NULL);
} //(Call FreeSid() when you’re done…)

Or, call LookupAccountSID and receive the name as an out parameter.

Or, use this Russian fellow's old util. http://www.chem.msu.su:8080/~rudnyi/NT/sid.txt (sid2user, user2sid, source code here.) from the command line or script and get output like this: 

C:\Documents and Settings\SHanselm\Desktop\Utils>user2sid "Everyone"
S-1-1-0
Number of subauthorities is 1
Domain is
Length of SID in memory is 12 bytes
Type of SID is SidTypeWellKnownGroup

C:\Documents and Settings\SHanselm\Desktop\Utils>sid2user 1 S-1-1-0
Name is Everyone
Domain is
Type of SID is SidTypeWellKnownGroup

I'm sure there's a way to do with from both Windows Scripting Host (VBS) and .NET (C#) given a SID, so if you know, let me know.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Recovering passwords from old locked Windows 2000 systems...

July 17, '03 Comments [1] Posted in Web Services
Sponsored By

I lost the Administrator password to an old Windows 2000 Server that needed to be patched desperately.  It had been running happily in my closet for over 2 years.

So, how to recover the Admin PW for this beAst?  There’s always:

But those cost more money than I am willing to put into this machine (as the machine is hardly worth $199, so, how about:

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

ASP.NET WebServices calling Apartment-Threaded COM Components...

July 17, '03 Comments [1] Posted in Web Services | ASP.NET | XML | Tools
Sponsored By

If you've ever had to call a VB6 Component from an ASP.NET (ASMX) XML Web Service, you may (most probably) get threading errors.  In ASP.NET Apps you can mark the Page directive with "ASPCompat='true'" but there is not a equivalent tag for Web Services.  So, there's a few things you can do:
  • Put the VB Component in COM+ (Preferred if the COM Object is part of a larger interaction, and you want fine control over your SOAP)
  • Figure out a different way to expose the COM Object as a Web Service, perhaps with Classic ASP and SOAP Toolkit 3.0 (Quick if you just want to get your component, but has larger design ramifications for big systems)
 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

"Kill Bill"/2 = "Wound Bill"

July 16, '03 Comments [1] Posted in Movies
Sponsored By

<rant>

Tarantino is in some kind of a race to end his already limping career.  What, does he think "Kill Bill" is "The Matrix" or "Lord of the Rings?"  I seriously doubt people are going to pay twice to see "Nearly Killed Bill" then "Finally Killed Bill"...we hate To be continued...on a Brady Bunch episode, how are we going to put up with it for a movie?  This is the kind of thing that made Back to the Future II and III suck so egregiously. 

</rant>

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

ATTN Presenters: Change your VS.NET Font Sizes, People!

July 16, '03 Comments [2] Posted in Web Services | Tools
Sponsored By

Once again, with the ruthless competence we've come to expect from Harry "DevHawk" Pierson, comes a very useful VS.NET macro.  It toggles your Font Sizes back and forth from (in the example) Courier New 10pt to the gloriously readable Lucida Console 18pt.  Get it, use it, make it so.  Thanks Harry!

It has been said before, but I shall rephrase:  If your presentation uses a projector, make sure the images you project are readable.  The time for "can you see this?" is NOT during your presentation.  If you do nothing else before a presentation go into Notepad, VS.NET and the Command Prompt and change your fonts. (You may be a great engineer, but you have it admit it's embarassing to hunt around in Tools|Options, like you've never been there before, and have the audience direct you to the right setting.)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.