Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KiraXie2 opened this issue Apr 4, 2023 · 4 comments
Assignees
Labels
waiting on input from dev team Waiting on dev team authors of sample to review

Comments

@KiraXie2
Copy link

KiraXie2 commented Apr 4, 2023

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

@phecke
Copy link
Member

phecke commented Apr 7, 2023

@KiraXie2 Which code sample are you referring to?

@phecke phecke added the waiting on input from dev team Waiting on dev team authors of sample to review label Apr 15, 2023
@phecke
Copy link
Member

phecke commented Apr 18, 2023

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

@krishnapallavi krishnapallavi self-assigned this Apr 20, 2023
@krishnapallavi
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting on input from dev team Waiting on dev team authors of sample to review
Projects
None yet
Development

No branches or pull requests

3 participants