Added unless attribute to check if machine is domain joined, and removed similar code from the PowerShell script.