I am in no way an expert on this but there was a time this was buggy in .NET 4.0. Also it would be somewhat useful to know what code the call threw at you. My bet is it was some "denied" code like 80005000 or such. You can find the bug in the old .NET with a google on just the word PrincipalOperationException.
As far as an (ugly?) workaround, this may be the time to use try and catch.
The second idea to try is run the app and command line with an elevated permission.