Closed Borgquite closed 2 years ago
Ah, so that exception appears when there is no security identity with that name in the current domain. Of course when using variables here, there most likely won't be an account with such a name. I will add code to process this situation - the name will be saved, but the SID property will remain unpopulated.
@Borgquite Please check the dev branch
Thanks - seems to be suppressing the error. May need to wait for the new version to be deployed before I can fully test in DSC (can't really deploy dev modules to a production server)
Managed to get a test environment where I could update the module, works w/ DSC :)
Fixed in e5bc74ec5ec364de9a393e8ce5a1bcd67a72a271
OK, here goes
I'm trying to automate the steps in the following guides for managing a number of local groups via Group Policy Preferences:
However New-GPPGroupMember currently throws an exception if the group name passed can't be translated at runtime and the guide involves creating group names which include a preference process variable (https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn789194(v=ws.11)#preference-process-variables)
Please could this exception be caught with a try / catch loop? I have tried using -ErrorAction SilentlyContinue but the exception is still thrown 'behind the scenes' and since I am trying to do this with PowerShell DSC and it doesn't like exceptions at all.