No error, also no result

Welcome Forums General PowerShell Q&A No error, also no result

Viewing 6 reply threads
  • Author
    Posts
    • #266678
      Participant
      Topics: 6
      Replies: 3
      Points: 85
      Rank: Member

      Hello,

      I like to use this script , to create a new account in Ad.

      When I walk through the settings , I do get a value for $Username
      Only I do not get this user in AD, ( also not when I # silentlycontinue)

      Hopefully a pointer in the right direction help me solve to find out what I can do to resolve it.

      Thanks for any help,

      • This topic was modified 1 month ago by PBA121137. Reason: Changed a few things after posting
      • This topic was modified 1 month ago by grokkit. Reason: code formatting
    • #266687
      Participant
      Topics: 0
      Replies: 10
      Points: 70
      Rank: Member

      On line 23 you’re setting the error action to “SilentlyContinue” which is why you are not seeing any errors. Comment out this line and hopefully you’ll get an error that will help.

    • #266699
      Participant
      Topics: 2
      Replies: 380
      Points: 513
      Helping Hand
      Rank: Major Contributor

      On line 42 you are missing a ‘d’ from ‘Emailaddress’.

      When you add the ‘d’ back the script runs successfully.

    • #266705
      Participant
      Topics: 6
      Replies: 3
      Points: 85
      Rank: Member

      On line 23 you’re setting the error action to “SilentlyContinue” which is why you are not seeing any errors. Comment out this line and hopefully you’ll get an error that will help.

      Thanx fore the reply, unforntunatlety , still no error , also no AdUser.

    • #266708
      Participant
      Topics: 6
      Replies: 3
      Points: 85
      Rank: Member

      On line 42 you are missing a ‘d’ from ‘Emailaddress’.

      When you add the ‘d’ back the script runs successfully.

      Thank you for the correction, I changed it indeed after youre reply.
      However, it did not made it happen for a ADUSer.

    • #266714
      Participant
      Topics: 2
      Replies: 380
      Points: 513
      Helping Hand
      Rank: Major Contributor

      OK, it ran fine for me after making that change although I note address is spelled incorrectly throughout the script so that requires further correction.

      Try commenting out all the parameters with ‘#’ at the beginning of each line (lines 32-42), except for line 33 which is the only mandatory parameter for New-ADUser.

      Also, add the -whatif parameter to the New-ADUser command, if it tries to create the user, you should see the ‘What if:’ statement.

      Add the parameters back, one-by-one, until you find the culprit.

    • #266912
      Participant
      Topics: 9
      Replies: 676
      Points: 2,674
      Helping Hand
      Rank: Community Hero

      Also please format your code properly when posting. Here’s the guide if you need a refresher.

Viewing 6 reply threads
  • You must be logged in to reply to this topic.