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

Support Powershell x86 Issue #615 - Alternate Implementation of Set-LocalUser #658

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

PrajeetGuha
Copy link
Contributor

@PrajeetGuha PrajeetGuha commented Feb 9, 2025

I have added the alternate implementation of the Set-LocalUser and hence the code is working in both powershell x86 and x64 without any issue. I have used WMIC functionality to do the same activity of making the password of the user to never expire. Since the x86 related issue was limited to that only function, I have also removed the check condition of the powershell.

Closes #615

Copy link

google-cla bot commented Feb 9, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @PrajeetGuha and sorry for the late reply (I was not able to do much testing while working on #660 as it keeps busy my VirtualBox). I have tested locally and seems to work as expected. 😄

@PrajeetGuha can you sign Google CLA? We are not able to merge the PR until the CLA check succeeds. It seems to also be detecting that the commit email is not associated with your GH account. Let me know if you need help.

image

@PrajeetGuha
Copy link
Contributor Author

PrajeetGuha commented Feb 14, 2025

Thanks for your reply @Ana06 . I am actually facing a problem with the CLA. I have actually authored the commit with my local PC which was configured with a random non-existent mail id as authoring information. Since I am new to open source contributions, I did not know it will cause this issue. I also could not find any way to change or resolve the issue.
Could you suggest anyway to resolve it?😅
I have signed the CLA with this GH account as evident from mandiant/VM-Packages#1273

@Ana06
Copy link
Member

Ana06 commented Feb 17, 2025

@PrajeetGuha you can change the commit author of the last commit with:

git commit --amend --author="Author Name <[email protected]>" --no-edit

You can change the global git configuration (so that it is applied for all future commits) with:

git config --global user.name "Author Name"
git config --global user.email "[email protected]"

Let me know if this work. 😊

@PrajeetGuha
Copy link
Contributor Author

Thanks @Ana06 for the help. I did the changes. Looks like it passed the CLA check now.
image

Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @PrajeetGuha!

@Ana06 Ana06 merged commit 4b46dc2 into mandiant:main Feb 18, 2025
2 checks passed
@@ -340,7 +332,7 @@ if (-not $noChecks.IsPresent) {
}

Write-Host "[+] Setting password to never expire to avoid that a password expiration blocks the installation..."
Set-LocalUser -Name "${Env:UserName}" -PasswordNeverExpires $true
wmic useraccount here "name='${Env:UserName}'" set PasswordExpires=False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a typo here, it should be where

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there was a mistypo on my part, and I apologize for that. However, we may have a better alternative to the WMIC implementation that can be reviewed.
#663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Powershell x86
3 participants