Powershell script issues

%3CLINGO-SUB%20id%3D%22lingo-sub-2224051%22%20slang%3D%22en-US%22%3EPowershell%20script%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2224051%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%3C%2FP%3E%3CP%3EI%20would%20like%20some%20help%20related%20with%20some%20scripts%20in%20Microsoft%20Endpoint%20Manager.%3C%2FP%3E%3CP%3EWe%20already%20create%20a%20script%20that%20change%20name%20of%20the%20device%20when%20it%20deploy%20autopilot.%20The%20script%20works%20perfectly%20but%20when%20we%20see%20the%20status%20of%20the%20script%20in%20intune%2C%20its%20showed%20like%20failed!.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20know%20if%20this%20script%20need%20something%20else.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBelow%20is%20the%20script%20that%20we%20just%20create.%3C%2FP%3E%3CP%3ELike%20i%20said%2C%20when%20this%20script%20is%20deploy%20in%20a%20device%2C%20it%20works%20perfectly!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20when%20we%20like%20to%20see%20the%20status%20of%20that%20script%20in%20intune%20it%20show%20like%20this!%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Oscarrdz_1-1616197233418.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F265777i697EA387CA72BA32%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Oscarrdz_1-1616197233418.png%22%20alt%3D%22Oscarrdz_1-1616197233418.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Oscarrdz_0-1616196986428.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F265762i695C46EC64507A00%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Oscarrdz_0-1616196986428.png%22%20alt%3D%22Oscarrdz_0-1616196986428.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThanks%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2224051%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi everyone,

I would like some help related with some scripts in Microsoft Endpoint Manager.

We already create a script that change name of the device when it deploy autopilot. The script works perfectly but when we see the status of the script in intune, its showed like failed!.

 

I would like to know if this script need something else. 

 

Below is the script that we just create.

Like i said, when this script is deploy in a device, it works perfectly!!

 

But when we like to see the status of that script in intune it show like this!

Oscarrdz_1-1616197233418.png

 

 

Oscarrdz_0-1616196986428.png

Thanks 

 

0 Replies