AuditPolicyDsc
AuditPolicyDsc copied to clipboard
i18n for this module needs a lot of work
I am currently testing this in a Windows 7 that is in spanish. In this version of Windows, the output of auditpol looks a lot like
auditpol /get /category:* /r | select -first 3 Machine Name,Policy Target,Subcategory,Subcategory GUID,Inclusion Setting,Exclusion Setting
home-pc,System,Extensión del sistema de seguridad,{0CCE9211-69AE-11D9-BED3-505054503030},Aciertos,
the key to the validation stage of your dsc resource is the Test-TargetResource function which only looks for Success or Failure
I am aware of the localization problem. The AuditPolicyCSV resource uses auditpol backup and restore which uses the SubcategoryGUID and the flag and ignores all of the text as a stop gap.
Can you post the Spanish test for 'Success and Failure' and 'Failure', so so that I can try out a few ideas?
Yes. I saw that and I wondered why you didnt do the same thing with the other setting. Then I thought I would avoid it if at all possible due to the race condition implicit in backing up the policy and reading the backup
Here are a few examples
machine_name,System,Extensión del sistema de seguridad,{0CCE9211-69AE-11D9-BED3-505054503030},Aciertos, machine_name,System,Objeto de kernel,{0CCE921F-69AE-11D9-BED3-505054503030},Errores, machine_name,System,Inicio de sesión especial,{0CCE921B-69AE-11D9-BED3-505054503030},Aciertos y errores,
Be careful, because in spanish you have "Errores" and "Aciertos y errores" notice the lower case there. You might not have problems because i think most operators are case insensitive, but i havent used match a lot which i think is something you use
I think I once solved this using a hashtable with the words in spanish as key and the words in english as the data. But it's not something I'd love to mantain and add new languages
Would the easiest be to add localization strings for these?
Is it the same problem for the headers? `
PS > auditpol.exe /get /Subcategory:"Logon" /r
Machine Name,Policy Target,Subcategory,Subcategory GUID,Inclusion Setting,Exclusion Setting
PC,System,Logon,{0CCE9215-69AE-11D9-BED3-505054503030},Success,
It's used here
https://github.com/PowerShell/AuditPolicyDsc/blob/e5b6204491ef0310734f424d49de436434eb76ec/DSCResources/MSFT_AuditPolicySubcategory/MSFT_AuditPolicySubcategory.psm1#L222
@imarambiocatan Thanks for the additional info. Yeah the CSV resource is a straightforward one and done compare. Can I ask you to reply with the local Spanish version of the en-US language file located here? https://github.com/PowerShell/AuditPolicyDsc/blob/e5b6204491ef0310734f424d49de436434eb76ec/DSCResources/MSFT_AuditPolicySubcategory/en-US/MSFT_AuditPolicySubcategory.strings.psd1
@johlju localization strings are what I had in mind.
Sorry @athaynes I'm not quite sure what you need. I have never seen localization strings before. Can you explain a bit better or at the very least provide an example?
@athaynes Maybe you can make a gist (or add a helper script to the module) with the commands necessary to output the necessary text that can be used to find the correct strings? It could be used by others to get the correct string for other languages too.
@imarambiocatan Sorry for the delay. Can you send me the string for 'No Auditing' as well as the result of $PSUICulture on your system? I think I have the test and get sorted out with a localization file. Regarding the set function, what does 'auditpol /set /?' look like for you? Do you still have the /success:enable and /failure:disable or are those fields localized as well? Thanks again for helping me get the localization sorted out.
Sorry @athaynes, I no longer work for the company for which I was doing this, so I don't have access to either the server or my code