<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:forums' matching tags 'Registry' and 'SYSInternals'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=app:forums&amp;tag=Registry,SYSInternals&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:forums' matching tags 'Registry' and 'SYSInternals'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Re: Computer SID</title><link>http://powershell.com/cs/forums/thread/2696.aspx</link><pubDate>Wed, 10 Jun 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:2696</guid><dc:creator>Aleksandar</dc:creator><description>&lt;p&gt;Let&amp;#39;s start with the theory. ;)&lt;/p&gt;
&lt;p&gt;The computer&amp;#39;s SID is stored in the HKEY_LOCAL_MACHINE\SECURITY\SAM\Domains\Account Registry subkey. This key has a value named F and a value named V. The V value is a binary value that has the computer SID embedded within it at the end of its data. This SID is in a standard format (3 32-bit subauthorities preceded by three 32-bit authority fields).&lt;/p&gt;
&lt;p&gt;Because you can&amp;#39;t see the SECURITY hive&amp;#39;s contents by default (even as an administrator), you need a little trick. &lt;strong&gt;Use &lt;em&gt;at&lt;/em&gt; command to schedule the startup of PowerShell.&lt;/strong&gt; Make sure that you schedule the task as Interactive and that the Scheduler service runs in the security context of the System (aka LocalSystem) account because this account&amp;mdash;unlike a regular user account&amp;mdash;has privileges to view the SAM and SECURITY hives.&lt;/p&gt;
&lt;p&gt;c:\&amp;gt; at&amp;nbsp;&amp;lt;TIME&amp;gt;&amp;nbsp;/interactive powershell.exe&lt;/p&gt;
&lt;p&gt;PS&amp;gt; $key = Get-Item HKLM:\security\sam\domains\account&lt;br /&gt;PS&amp;gt; $values = Get-ItemProperty $key.pspath&lt;br /&gt;PS&amp;gt; $bytearray = $values.V&lt;br /&gt;PS&amp;gt; New-Object System.Security.Principal.SecurityIdentifier($bytearray[272..295],0) | fl *&lt;/p&gt;
&lt;p&gt;BinaryLength&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;: 24&lt;br /&gt;AccountDomainSid : S-1-5-21-796845957-602608370-839522115&lt;br /&gt;Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : S-1-5-21-796845957-602608370-839522115&lt;/p&gt;
&lt;p&gt;You can check your result with Sysinternals&amp;#39; PsGetSid:&lt;/p&gt;
&lt;p&gt;PS&amp;gt; .\psgetsid.exe &lt;/p&gt;
&lt;p&gt;SID for &lt;a&gt;\\COMPUTER&lt;/a&gt;:&lt;br /&gt;S-1-5-21-796845957-602608370-839522115&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-aleksandar (&lt;a href="http://powershellers.blogspot.com"&gt;http://powershellers.blogspot.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>