[WinXP] Get localized LocalSystem-Account


recently I had to write an VBScript for dynamic commandline creation for the setup of SQL Server 2008 Express.
There I had an issue to find the localized version of the LocalSystem-Account in Windows XP.

On most client workstation it was "NT AUTHORITY\SYSTEM" but on some it was "NT-AUTORITÄT\SYSTEM" (localized version on german os).

I didn't found any reliable way to gather the localized version from the registry.
After several unseccesful ways to gain the localized version I found the solution in getting the ProcessOwner of the process System.

strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")

Set colProcessList = objWMIService.ExecQuery("Select * from " & _
"Win32_Process where Name = 'System'")

For Each objProcess in colProcessList
colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain)
strSystemUser = strUserDomain & "\" & strNameOfUser

I hope this could save much time for someone sometime.

Anyone who had the same issue and found any other reliable approach?

0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ