Leberschnitzel Posted December 21, 2016 Share Posted December 21, 2016 Hi everyone, I have an easy problem: I need to schedule a task for the group "Users". This works nicely on English PCs, but on German and French it doesn't since the users group isn't called users there. Using the SID also doesn't work since the scheduler doesn't allow SID use in the CMD... Long story short: This doesn't seem to work: $objWMIService = ObjGet ("winmgmts:\\" & @ComputerName & "\root\cimv2") $UserGroup = $objWMIService.ExecQuery ("Select Name from Win32_Group Where SID = 'S-1-5-32-545'") MsgBox(0,"",$UserGroup) I just get an empty popup instead of, like I hoped, the name of the users group. Any idea how I can make this work easy? Thank you very much for your time Kind Regards Christian Link to comment Share on other sites More sharing options...
Leberschnitzel Posted December 21, 2016 Author Share Posted December 21, 2016 $objWMIService = ObjGet ("winmgmts:\\" & @ComputerName & "\root\cimv2") $colItems = $objWMIService.ExecQuery ("Select Name from Win32_Group Where SID = 'S-1-5-32-545'") For $GroupNames in $colItems MsgBox (0,"",$GroupNames.Name) ExitLoop Next This works now quick and very dirty. I exit the loop there because otherwise it seems to run for a very long time. Link to comment Share on other sites More sharing options...
Gianni Posted December 21, 2016 Share Posted December 21, 2016 you might be interested in this function: _Security__LookupAccountSid() Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now