microsoft / microsoft/PowerApps-Samples

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

Open
#413 4 comments 0 reactions 1 assignee View on GitHub

@krishnapallavi is already working on this.

Since Apr 20, 2023.

waiting on input from dev team
Dominant language
C#
Stars
2k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.