2 ms·
Ran into something similar before on Windows with the permission system - The name of the 'everyone' group is not fixed, and varies by locale. Unfortunately not
by jameshart 11y ago
Ran into something similar before on Windows with the permission system - The name of the 'everyone' group is not fixed, and varies by locale. Unfortunately not all windows commands accept SIDs, and you'll need to know the localized name for the 'everyone' group to call them. Windows's troubled languagepack journey and backwards compatibility shackles do mean that design decisions on basic file-handling commands that were reasonable in 1995 look pretty dumb now.
PowerShell is making this better, but of course when you 'shell out' from PSH to a legacy command you're stuck with its crappy commandline parsing which is designed to be backwards compatible with batch files written 20 years ago. The powershell way to do this (assuming 'set-owner' isn't built in to PSH) is probably to end-run round takeown.exe and work with the shell win32 APIs directly (or google for a cmdlet someone else has written that does that for you).