PowerApps-Samples icon indicating copy to clipboard operation
PowerApps-Samples copied to clipboard

"Remove-RoleAssignmentFromUsers" throws error System.ArgumentNullException: Value cannot be null. Parameter name: path1

Open KiraXie2 opened this issue 2 years ago • 4 comments

I run this command: Remove-RoleAssignmentFromUsers -roleName "System Administrator" -usersFilePath C:\temp\230404David.csv -processAllEnvironments $true -outputLogsDirectory C:\temp\DavidRemovedRoles

However, there is no successful role removement. The error is: Exception while retrieving users with role name System Administrator from environment https://zfsalescoretest.crm.dynamics.com : System.ArgumentNullException: Value cannot be null. Parameter name: path1 at System.IO.Path.Combine(String path1, String path2) at Microsoft.PowerPlatform.Administration.Helpers.Logger.GetRoleRemovalLogPath(String logLocation, String orgName, String roleName) in C:\Users\Z0147856\PowerApps-Samples\powershell\UserManagement\Microsoft.PowerPlatform.Administration.UserManagement\Microsoft.PowerPlatform.Administration.Helpers\Logger.cs:line 110 at Microsoft.PowerPlatform.Administration.Helpers.EnvironmentOperationsHelper.RemoveRolesFromUsersInEnvironment(String userName, String password, String roleName, String environmentUrl, IList`1 userPrincipalNames) in C:\Users\Z0147856\PowerApps-Samples\powershell\UserManagement\Microsoft.PowerPlatform.Administration.UserManagement\Microsoft.PowerPlatform.Administration.Helpers\EnvironmentOperationsHelper.cs:line 116

KiraXie2 avatar Apr 04 '23 06:04 KiraXie2

@KiraXie2 Which code sample are you referring to?

phecke avatar Apr 07 '23 21:04 phecke

https://github.com/microsoft/PowerApps-Samples/tree/master/powershell/UserManagement/Microsoft.PowerPlatform.Administration.UserManagement

KiraXie2 avatar Apr 10 '23 02:04 KiraXie2

The owning team (Pallavi V.) has been notified and will investigate.

phecke avatar Apr 18 '23 17:04 phecke

This was fixed as part of this PR. @KiraXie2 can you please pull the latest version and try?

krishnapallavi avatar Apr 20 '23 20:04 krishnapallavi