Forum Discussion
ksclifton
May 13, 2022Copper Contributor
Local Admin Password expiration
Hello, I am working on trying to run a script to change the local admin password to not expire. In the early stages of Intune, I setup a local admin account and failed to set the password to expire,...
- May 16, 2022You need to check the "Run script in 64-bit PowerShell Host" as the localgroup*/localuser* cmdlets are only available on a 64-bit PowerShell, otherwise it will fail. 👍
May 13, 2022
Hi
You indeed need PowerShell... but normally powershell is installed by default on the device 🙂
get-localuser | Set-localUser -PasswordNeverExpires:$True
https://call4cloud.nl/2020/03/remove-all-local-admins/
You indeed need PowerShell... but normally powershell is installed by default on the device 🙂
get-localuser | Set-localUser -PasswordNeverExpires:$True
https://call4cloud.nl/2020/03/remove-all-local-admins/
ksclifton
May 14, 2022Copper Contributor
I don't mean the normal PowerShell, yes that is installed on both devices, while reviewing the learn MEM book, it talks about enabling Microsoft Intune PowerShell, that doesn't seem to be an option, when I ran the powershell-intune-samples-master off github, my credentials were not high enough in other areas of Azure for it to work. My question is, do I have to somehow enable Microsoft Intune Powershell, to run powershell scripts in Intune. When I took the course it was never covered that any special steps were needed to run scripts on devices through Endpoint.
- May 14, 2022Powershell has modules that can be installed so you can managed Microsoft Intune with it. As example you can use powershell to deploy device configurations and conditional access to your tenant.
When using proactive remediations it doesn't need it...(or your powershell script needs that module for some specific operations) but the example I gave you it doesn't need anything special....- kscliftonMay 14, 2022Copper Contributor
Thank you for the replay, I took the script you gave and put it into PowerShell ISE and saved the .ps1 file.
Added to scrips in Endpoint.
When the script would run, I received
I am assuming, I missed something. The local "admin" account password is still not set to not expire.
I test the PowerShell on the test device and it ran correctly.
- May 16, 2022You need to check the "Run script in 64-bit PowerShell Host" as the localgroup*/localuser* cmdlets are only available on a 64-bit PowerShell, otherwise it will fail. 👍