Simple SCCM 2207 'Run Script' doesn't work

Shane 0 Reputation points
2023-03-10T21:51:52.71+00:00

Good afternoon -

I created a simple PoSH script in 'Run Scripts' to create a local account on some PCs. Simply speaking, it returns an Exit Code of 0 but it's not creating the account on the client. I ran the script locally on a client to test it and it works, but it just doesn't work via SCCM. I think I'm forgetting something..what, I don't know. (I'm still learning SCCM). I have another script, created 4-5yrs ago, which does the same exact thing, and it works. I just copied that code and modifed the user/pwd for my current needs. I approved it, then thought I could rt-click a Client > Run Script, and it would just work. But, it isn't. What am I forgetting/missing? It's not like Applications where you have to Distribute a Script to the DP, correct? Or, do you? My version of SCCM is 2207. I did spend a couple hours searching around the Webz and it seems to be Scripts are straightforward. Just create. Approve. Run. But, for some reason...this new Script isn't working. A final bit of info - I did check the Script.log on the Client and see PoSH is at least attempting to execute this new script. There are no errors or warnings or anything. I get the same log output when running this failed script as the other working scripts. Also, when I run the working script...it provides 'details/output' after it runs in the Run Script wizard/Script Status window in SCCM. When I run the new Script...it doesn't generate output. But, it does return an Exit Code of 0. Again, any ideas?

Thanks all.

Microsoft Security Intune Configuration Manager Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Shane 0 Reputation points
    2023-03-10T23:32:21.6166667+00:00

    I figured this out. It seems Win10 PCs need pwds longer than 8 char's. I configured my pwd in the PoSH script to be at 8 char's, which is what Local Password Security policy says is default. After I modified my Script user pwd to be 9 char's, it worked.

    Thanks!

    0 comments No comments

  2. CherryZhang-MSFT 6,496 Reputation points
    2023-03-13T09:16:08.36+00:00

    Hi @Shane

    Thanks for your feedback and sharing. We're glad that the question is fixed now. Here's a short summary for the problem, we believe this will help other users to search for useful information more quickly. It's appreciated that you could click "Accept Answer" to the reply.

    Problem/Symptom:
    Use SCCM 'Run Scripts' to create a local account on some PCs, it doesn't work.

    Solution/Workaround:

    Modify the script user pwd to be greater than 8 characters and it works.

    Thanks again for your time and patience!

    Best regards,
    Cherry

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.