How to push/deploy local admin account/access on Windows devices via Intune? Is there any way by which we can achieve this and also should be able to revoke/remove it after work?

Vinod Survase 4,716 Reputation points
2023-10-13T17:00:30.51+00:00

How to push/deploy local admin account/access on Windows devices via Intune? Is there any way by which we can achieve this and also should be able to revoke/remove it after work?

Microsoft Intune Security
Microsoft Intune Security
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
370 questions
Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,783 questions
Microsoft Intune Enrollment
Microsoft Intune Enrollment
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Enrollment: The process of requesting, receiving, and installing a certificate.
1,301 questions
Microsoft Intune Updates
Microsoft Intune Updates
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Updates: Broadly released fixes addressing specific issue(s) or related bug(s). Updates may also include new or modified features (i.e. changing default behavior).
90 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,657 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZhoumingDuan-MSFT 10,580 Reputation points Microsoft Vendor
    2023-10-16T05:19:54.51+00:00

    @Vinod Survase,Thanks for posting in Q&A.

    From you description, I know that you want to deploy local admin account via Intune and remove it after work.

    Based on my testing, you can deploy local admin account via PowerShell in Intune and here are the contents of script:

    $Password = ConvertTo-SecureString "Password01!" -AsPlainText -Force

    New-LocalUser "newadmin" -Password $Password -FullName "new admin" -Description "Temporary local admin"

    Add-LocalGroupMember -Group "Administrators" -Member "newadmin"

    You should first create a .ps1 file and manually run the script on device with admin account, if it works, you can upload the script into Intune. Location: Intune Admin center > Devices > Scripts > Add Windows 10 and later.

    User's image

    Moreover, if you want to remove the local admin account after it work, you can try the script below and please do the same as the deployment of the above script.

    Remove-LocalUser -Name "local admin account"

    Hope this can be helpful, if there is any update, feel free to contact me.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more