Hello,

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
Next

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

Comments

Please log in to comment

There are no answers at this time
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

Answer this question or Comment on this question for clarity