Luziekix
(Getting the hang of it)
2003-10-14 11:58 AM
How can I get SID of my Workstation

Hi,

how can I get the SID of my Workstation (Windows XP) - NOT the users SID ?

Or do I understand something wrong, and only Users have a SID ?

Regards,

Luziekix


Howard Bullock
(KiX Supporter)
2003-10-14 01:41 PM
Re: How can I get SID of my Workstation

I have several methods by which you can get this information. Please tell me how you wish to gather it, what your reason is to get this info, and how you wish to use it.

I will dig up the code today.

[ 14. October 2003, 13:42: Message edited by: Howard Bullock ]


Sealeopard
(KiX Master)
2003-10-14 03:58 PM
Re: How can I get SID of my Workstation

Go to HKEY_USERS, the SID ending with -500 and which does not correspond to the other SIDs with regards ot the segments before the last dash is the computer's SID. The -500 indicates the local administrator account.

Howard Bullock
(KiX Supporter)
2003-10-14 04:01 PM
Re: How can I get SID of my Workstation

Good, easy solution Jens if the Admin user is logged on.

This key is better:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

as all profiles are listed all the time.

[ 14. October 2003, 16:05: Message edited by: Howard Bullock ]


Sealeopard
(KiX Master)
2003-10-14 04:04 PM
Re: How can I get SID of my Workstation

Or a remote admin script to collect the SIDs from all computers.

Luziekix
(Getting the hang of it)
2003-10-15 07:10 PM
Re: How can I get SID of my Workstation

Hi,

sorry for my late response.

We are using cloning here to install workstations, and I want to write a script which logs the workstations name and the workstation-SID into a plain text-file.

We just want to ensure, that thereīs no two workstations with the same SID.

SID is changed with NewSID from Sysinternals or GHOSTWALK from Symantec GHOST.

Regards,

Luziekix

[ 15. October 2003, 19:11: Message edited by: Luziekix ]


Sealeopard
(KiX Master)
2003-10-16 04:44 AM
Re: How can I get SID of my Workstation

SysPrep itself should also change the SID automatically, thus no need for external tools. So, just run an admin script every night that collects SIDs (e.g. via registry, as suggested) and then compares them with a list of existing SIDs. Fastest way would be to have a .INI file for this.

Kdyer
(KiX Supporter)
2003-10-16 09:37 PM
Re: How can I get SID of my Workstation

quote:

We are using cloning here to install workstations

Sysprep as Jens stated works great with Ghost. Just make sure that under XP that you choose the "seal" option. The wizard for Sysprep for 2000/XP are pretty easy to follow.

You should do this from RIS and GhostCast. We are able to do a 2GB image to a workstation in about 5-7 minutes.

Kent

[ 16. October 2003, 21:39: Message edited by: kdyer ]


Luziekix
(Getting the hang of it)
2003-10-21 02:02 PM
Re: How can I get SID of my Workstation

OK,

finally I found a Freeware-utility to get me the Workstations-SID called "PsGetSID"

at:

http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

Thank you all,

Luziekix


Howard Bullock
(KiX Supporter)
2003-10-21 02:05 PM
Re: How can I get SID of my Workstation

Don't know why you had to keep searching for an external utility when we gave you a method to get the information long ago using KiXtart.

Luziekix
(Getting the hang of it)
2006-10-19 11:07 AM
Re: How can I get SID of my Workstation

Iīm back after a long time ...

by comparing the results from Sysinternals PSGETSID-Utility
and by my own following script:

Code:
 
$Index=0
:LOOP1
$ValueName = ENUMKEY("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList", $Index)
; ? $ValueName
If @ERROR = 0
$PartValue=Right($ValueName,4)
$Index = $Index + 1
If $PartValue="-500"
$x=LEN($ValueName)-4
$WSSID=Left($ValueName,$x)
? $WSSID
Endif
goto Loop1
Endif

GET $X



I get different results. The problem is, that my script stops at the first key found which is ending with -500 an displays this as Workstation-SID. However there is another key ending with -500 on my computer and this "last" key ending with -500 should be the right workstation-SID from the SID-History.

Anyone can please tell me how I can alter my code to correct this,
or a better way to enumerate the last key ending with -500.
---> UPDATE: Itīs NOT the last key found ending with -500.
So I need to determine a way to find out which one of the -500 is the right ...

Regards,

Luziekix