Skip to main content

How can we help you?

Search

Comments

2 comments

  • Eric Vollbrecht

    The 3 lines of code in the IF statement of the PowerShell can be consolidated into 1 line. 

    $DsregCmdStatus = dsregcmd /status

    if ($DsregCmdStatus -match "DeviceId")
    {
      $DeviceId = (($DsregCmdStatus -match "DeviceID").Split(":").trim())[1]
    }
    $DeviceId
    0
  • Rich Kennedy

    Looking for help running script under Connectwise. It appears the context for the powershell launched by Automate is not the same as running the script from the powershell in the desktop.  As a consequence, the information returned by DSregcmd is not the same - the whole 'Work Account' section is missing - which has the DeviceID info. The USER STATE section shows "WorkplaceJoined : NO" - which is opposite from the desktop execution... Any guru's out there..?

    0

Please sign in to leave a comment.