I am currently creating a WAPT package to use a WSUS server in an environment without AD.
I'm not proficient in Python, and despite my research, I can't seem to preserve the character "é" in a string. I've tried several solutions, such as using "u" before it, without success.
Here is the relevant code snippet (the character is located in "unassigned computer"):
Code: Select all
#ouverture de la clef keygroupe=reg_openkey_noredir(HKEY_CURRENT_USER,'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\WindowsUpdate\\AU',sam=KEY_WRITE,create_if_missing=True)
#determine le groupe d'attribution de l'ordinateur
keyname=reg_openkey_noredir(HKEY_LOCAL_MACHINE,'SYSTEM\\ControlSet001\\Control\\ComputerName\\ComputerName',sam = KEY_READ)
localhost = reg_getvalue(keyname,'ComputerName')
if type(localhost[1:4]) == int:
groupe = 'Pedagogique'
else:
groupe = 'Ordinateur non attribué'
#indique le groupe d'attribution au serveur WSUS
reg_setvalue(keygroupe,'TargetGroupEnabled',1,REG_DWORD)
reg_setvalue(keygroupe,'TargetGroup',groupe,REG_SZ)
print('Ordinateur attribue au groupe ' + '"' + groupe + '"')Do you have a solution to properly account for this characteristic?
Thank you so much.
Antoine Cadou
