File Exchange

image thumbnail

GetSID - get unique Windows ID

version (1.38 KB) by Yair Altman
Gets a Window's system SID (unique computer ID)


Updated 27 Jul 2007

No License

GETSID scans the Windows registry for the SID data, and returns it if found. This is useful in cases where you wish to limit or change functionality for specific computers, and need an identifying ID. It is also a simple example of accessing Window's registry.

GETSID is equivalent to Microsoft's PsGetSid utility (

GETSID requires Microsoft Windows and works on Matlab 6 and up.

Cite As

Yair Altman (2021). GetSID - get unique Windows ID (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

mohammad ibrahim

thank you
a question: si this ID is the computer ID ? if Windows is updated , does this ID change ?
I am searching for a method to identify a "computer ID" that does not change with time even after several years

many thanks


Thank you!!!!

Yura Polyachenko

suong Tran

Thank you!!!!

James Kerns

Simple, but just what I needed. Always enjoy Yair's work.

Yair Altman

Urs is correct: the following shortened command get(,'DomainSID') returns the same information, using the registry just like this submission. My GetSID submission is much faster (0.5 mSecs vs. 15-20 mSecs on my machine), but the difference is negligible in most conceivable scenarios. Hats off.

urs (us) schwarz

an alternative

% with all the information you need:
% eg,

just a thought...

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!