powershell - Find admin group name -
i need find name of admin group local on windows computer powershell. example, if language french, "administrateurs" if it's english, it's "administrators".
i find vbs code solve problem.
strcomputer = "." set objwmiservice = getobject("winmgmts:\\" & strcomputer & "\root\cimv2") set colaccounts = objwmiservice.execquery _ ("select * win32_group localaccount = true , sid = 's-1-5-32-544'") each objaccount in colaccounts wscript.echo objaccount.name next
i'm starting powershell "translate" in powershell ?
try this:
gwmi win32_group -filter "localaccount = $true , sid = 's-1-5-32-544'" | select -expand name
Comments
Post a Comment