Getting localized NT AUTHORITY domain name
If you are dealing with built-in system accounts, like NT AUTHORITY\SYSTEM, this code can help you on localized Windows versions, where NT AUTHORITY domain is also translated, for example to NT-AUTORITÄT in German version. You can get localized name using it SID "S-1-5-18":
?GetObject("winmgmts:root\cimv2").Get("Win32_SID.SID='S-1-5-18'").ReferencedDomainName
You have to use this function, when you select system object using Object selection dialog as well.
Labels: Code Samples, VBA
0 Comments:
Post a Comment
<< Home