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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -