Return user SID

Return user SID

User specific data is stored in the SVS repository in a users SID key. Which is perfect since it is unique and independent of renaming of the user account. But to automatically change user settings you have to know the users SID. It might be possible with higher programming languages, but AFAIK batch/command files or script languages can't get the users SID robustly.

If Altiris could extend the ability of SVSCMD.exe to return the SID of the current user, e.g. with a command line parameter SID, it would simplify (or even enable) a scripting process.

SID <-> User Name

Scott Jones's picture

Scense does this for some of their functions. And I have to believe that there is a standard (and reliable) way to do this from WiseScript or VBScript. Any Windows/AD wizards out there know the answer?

As we evolve our user-based management options, I suspect we'll need to provide something like this in the SVS core product. For now, Altiris 7, Ardence, AppStream, Scense, ZENworks, etc. all handle this sort of linkage (when it's needed) at the management layer. But for support, or for administration in very small environments, I can see where it would be useful to do stuff on the command line (and client GUI) w/o having to know SIDs. The Protect client GUI already does it, now that I think of it... Not sure about the CLI and API.

Scott Jones
Product Manager
Altiris, Inc.

SID in SVS

erikw's picture

I have built a version for SvS to run on SBC, and in that version I capture the SID. It is easy to extend it and to translate the SID.

I'm going to think over it to build a little capture program to do this.

In VB script this is simple.

The version for Citrix and terminal servers already has this function.

Regards
Erik
www.svs4u.nl

Dear Erikw,

Dear Erikw,
Thanks for the reply. But I rather not want to have another executable. Since this would need to be disributed with a script. I would like to have it in the SVSCMD, so that I only need to distribute the script. Thanks for your help.

Sid in svscmd

erikw's picture

Altering svscmd and distributing is is not permitted by Altiris, and I understand why.

For now that is the best option.

In a later version it can be implemented in svscmd, and then everyone can use it.

Regards
Erik

www.svs4u.nl

Sorry for the

Sorry for the misunderstanding, I do not want to alter SVSCMD, neither to distribute it.

I only want to have the ability to get the SID from tools which are on the PC running SVS.

I would like to avoid distributing any other executable (there is an exe in a resource kit that does it, so no need to create a new one) that gives me this info.

SVScmd

erikw's picture

Great to hear that you have found a program in the Windows installation that can solve this.

Please provide me the name of the program.

Other people do have the same wish, and by providing the name, more people are helped.

Regards
Erik
www.svs4u.nl

GetSID

You are right. I should have posted the name of the file.

But I was on a run and only checked the juice quickly; didn't have the time to look things up.

Now that I did it, I realize that I made a mistake. The file I thought to do it is named getsid.exe. But it only compares two SIDs. A rough Google search didn't reveal a command line utility to do the trick.

The easy trick

erikw's picture

The easy trick is to write a command line util that does a search in the registry.

In the registry there are two values known.
The SID, and the logon name that is being used to create the SID.

I can build in the check in SVSCMD, but again that is altering the executable.

regards
Erik
www.svs4u.nl

Can you explain?

riva11's picture

Erik,

Can you explain your suggestion to create a script where a command is included to search in the registry?

Thanks

My guess is that he wants

My guess is that he wants to look for "HKEY_CURRENT_USER\
Software\Microsoft\
Protected Storage System Provider".

The first key is the SID of the user, at least on my PC. But I'm not sure if that is robust.

I still think it would be best to have it in the svscmd itself.

I agree

erikw's picture

Toralf,

I agree to get it in the SVSCMD.

Next month I have to do some work with the guys from Altiris to get it in the test lab and to get it integrated.

It will reduce the amount of problems.
It is also a very good step to go totally SVS.

Regards
Erik