During my work on another question, I found that I need to get the localised account name for the NT AUTHORITY\Network Service
account (who the &¤%@ localises account names??).
I have a work-around which involves running a bit of VBScript code, but since the rest of my project is in Powershell I think it would be "correct" to convert this code to Powershell (so I don't need to call VBScript from my Powershell, which I don't know how to do anyway...).
Any idea what this does, and how the same is done in Powershell?
Set objWMI = GetObject ("winmgmts:root\cimv2")
Set objSid = objWMI.Get ("Win32_SID.SID='S-1-5-20'")
Set MyDomain = objSid.ReferencedDomainName
Set MyAccount = objSid.AccountName