Here is the babelfish translation for that page
Hello Davide!
in the news contribution
I wanted to ask, whether and how it is possible in VB.NET the SID one
operating system to select (those, which one changes with the Clonen by means of Sysprep
should).
According to Marks of Russiovic
http://www.sysinternals.com/ntw2k/source/newsid.shtml
the Machine SID is in the RegistryKey
SECURITY\SAM\Domains\Account
This key has a binary value V and the last 96 bits contained that
Key.
To this key you come however only, if your program under that
System account runs. That is thus no passable way. Into regedit.exe see
You the key also only, if you regedit.exe under the system account
, small trick starts: start a command line and tap then
RK < time > /interactive regedit
, thus for example
RK 19:20 /interactive regedit
Then starts around 19:20 under the system account and you see that regedit
Key also.
You know however the program PsGetSid
http://www.sysinternals.com/ntw2k/freeware/psgetsid.shtml
use and the output parsen, similar to for instance for the last example
here:
http://groups.google.de/[email protected]...
Or in addition, this code use:
' reference on system management DLL set!
Import system management
Private Function GetMachineSid() As stringer
Dim query As ObjectQuery = _
New ObjectQuery(_
"SELECT * from Win32_UserAccount where Name='Administrator '")
Dim of searcher As ManagementObjectSearcher = _
New ManagementObjectSearcher(query)
Dim moc As ManagementObjectCollection = _
searcher.Get()
Dim sid As stringer
For Each mo As ManagementObject in moc
sid = mo("sid")
NEXT one
Dim pattern As stringer = _
"(?<MachineSid>\w-\d-\d-\d{2}-\d{10}-\d{10}-\d{10})"
Dim move As Regex = new Regex(pattern)
Dim mc As MatchCollection = reg.Matches(sid)
Return mc(0).Groups("MachineSid").Value
End to Function
This code gets itself the SID of the administrator and uses the Pattern,
over
to filter the Machine SID, those in the user SID of the administrator
is always contained. I hope that I described the Pattern correctly
, on that me accessible computers it has perfectly functioned.
Details to SIDs by the way give it in the outstanding book
The NET Developer's Guide ton of Windows Security
By Keith Brown
Publisher: Addison Wesley
Pub DATE: Septembers 27, 2004
ISBN: 0-321-22835-9
Pages: 408
http://www.awprofessional.com/title/0321228359
Greeting
Arne Janning
Arne said:
Hi Herfried!
Should the machine SID not be unique as well? I'm not 100% sure but I think
so.
Getting the machine SID in VB.NET:
http://groups.google.de/group/microsoft.public.de.german.entwickler.dotnet.vb/msg/2bfd79f4560ddc1b
(In german, just have a look at the code)
Cheers
Arne Janning
--
Kind Regards
David Huisman
General Manager
-----------------------------------------------------------------------
ORBIT COMMUNICATIONS Pty Ltd - Wireless Solutions that Work
(Telemetry, Control, Monitoring, Security, HVAC ...)
A.C.N. 107 441 869
Website :
http://www.orbitcoms.com
PO Box 4474 Lakehaven
NSW 2263, AUSTRALIA
Phone: 61-2-4393-3627
Fax : 61-2-4393-3685
Mobile: 61-413-715-986