locked
Powershell script RRS feed

Answers

All replies

  • Hi,

    It's hard to help you if you don't post your script.


    Don't retire TechNet! - (Don't give up yet - 12,700+ strong and growing)

    Thursday, February 20, 2014 2:58 PM
  • Please read:

    How to Write a Bad Forum Post

    In particular, items 6 and 7.

    Bill

    • Marked as answer by Bill_Stewart Monday, March 10, 2014 8:16 PM
    Friday, February 21, 2014 8:49 AM
  • More like this guy is just trying to be a wise guy.

    There is no question.  This appears to be just random unreadable postings.

    Any technician would knowenough to post a custom file like this to the vendor forum first.  This is a PFF file which is proprietary to Sapien and it is a third party script produced by a Sapien partner to add users.  It has been altered.

    The OP should either post in vendor forum or post a link to the PFF file.

    The script should be reduced the least amount of code necessary to demonstrate the problem.  In the process of doing thisit is likely that the issue will be discovered.


    ¯\_(ツ)_/¯


    • Edited by jrv Friday, February 21, 2014 12:48 PM
    Friday, February 21, 2014 12:43 PM
  • New-ADUser : The object name has bad syntax

    at C:\Scripts\NewuserG1.ps1:365 char:13

    +            New-ADUser <<<< @User -ErrorVarible ADError

    +            CategoryInfo              : NotSpecified: (CN=Robert Bard,...3user.local:String)  [New-ADuser], ADException

    + FullyQualifiedErrorID : The object name has bad syntax, Microsoft.ActiveDirectory.Management.Commands.NewADUser

    
    
    

    This error message is pretty explicit if you read it carefully.  The items provided to the splat are not correct for the CmdLet around the item that is noted: NotSpecified: (CN=Robert Bard,...3user.local:String) 

    This format is not correct.

    I recommend either placing trace statements or running under debugger.  The modified code has broken the original form format and design.  GO back andlook at how you altered the logic for building this "splat".

    I know that it is likely that you have little or no PowerShell experience which is what has led to dumping all of this here. Unfortunately we cannot debug a 1200+ line script for you.  You will have to step through this with a debugger or remember what you changed that could have caused this.


    ¯\_(ツ)_/¯

    Friday, February 21, 2014 1:07 PM
  • The problem is in your XML changes.  You have broken the syntax by not using a legal distinguishedname.

    See:

       <Path>OU=Users 100MB Mailbox,OU=Users,OU=Cop,OU=DK,OU=Nordic,DC=internal,DC=local</Path>

    That is what a path should look like.  Look at yours.


    ¯\_(ツ)_/¯

    Friday, February 21, 2014 1:49 PM