Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING PowerShell not recognize dsregcmd

dellas

New Member
Messages
1
Reaction score
0
Points
1
We have several devices showing a “Pending” status in Microsoft Entra ID.
The recommendation we received is to run the following commands to refresh the registration:

dsregcmd /leave
dsregcmd /join

This works perfectly when we run the commands manually on a local machine.
To automate the process, we created a PowerShell script using those commands and tested it locally — it runs without any issues.
However, when we deployed the same script through Microsoft Configuration Manager (SCCM) as a package, PowerShell doesn’t recognize the dsregcmd command.
I’ve already checked several options online, but none of the solutions worked.
Has anyone faced this issue with dsregcmd not being recognized when executed via SCCM?
Any advice or best practices to make this work in a deployment context would be appreciated.
 

Attachments

  • image (1).png
    image (1).png
    55.6 KB · Views: 4
We have several devices showing a “Pending” status in Microsoft Entra ID.
The recommendation we received is to run the following commands to refresh the registration:

dsregcmd /leave
dsregcmd /join

This works perfectly when we run the commands manually on a local machine.
To automate the process, we created a PowerShell script using those commands and tested it locally — it runs without any issues.
However, when we deployed the same script through Microsoft Configuration Manager (SCCM) as a package, PowerShell doesn’t recognize the dsregcmd command.
I’ve already checked several options online, but none of the solutions worked.
Has anyone faced this issue with dsregcmd not being recognized when executed via SCCM?
Any advice or best practices to make this work in a deployment context would be appreciated.
This will be a x86 cmd issue. Adjust your script to reload as a x64 and run the cmd again.
you can learn more about the problem in this blog. https://www.recastsoftware.com/resources/how-to-access-the-local-system-account/
 
We have several devices showing a “Pending” status in Microsoft Entra ID.
The recommendation we received is to run the following commands to refresh the registration:

dsregcmd /leave
dsregcmd /join

This works perfectly when we run the commands manually on a local machine.
To automate the process, we created a PowerShell script using those commands and tested it locally — it runs without any issues.
However, when we deployed the same script through Microsoft Configuration Manager (SCCM) as a package, PowerShell doesn’t recognize the dsregcmd command.
I’ve already checked several options online, but none of the solutions worked.
Has anyone faced this issue with dsregcmd not being recognized when executed via SCCM?
Any advice or best practices to make this work in a deployment context would be appreciated.
I presume within your command you have typed Set-ExecutionPolicy –ExecutionPolicy Bypass –Force
 

Forum statistics

Threads
7,085
Messages
27,676
Members
17,924
Latest member
rossydro

Trending content

Back
Top