[WinXP] Get localized LocalSystem-Account
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.
I hope this could save much time for someone sometime.
Anyone who had the same issue and found any other reliable approach?
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
Answers (0)
Please log in to answer
Be the first to answer this question

so that the conversation will remain readable.