I want to create computer objects without accessing the ARS console

I tried with the below code but it gives error.

powershell.exe -command New-QADComputer -Name <Name of the new computer> -ParentContainer "<OU-Copied the distinguishedName of an earlier computer object from the AD>" -ObjectAttributes @{edsajoincomputertodomain='domain\userID'}
Parents Reply Children
  • First of all, you need to make sure that you have the Quest cmdlets installed on the machine where you wish to run this script.  

    Launch a powershell window and try this command:

    import-module activerolesmanagementshell

    If it doesn't work, get whomever manages ActiveRoles in your environment to provide these to you.

    Next, I would create a script file containing your code so something this like this:

    import-module activerolesmanagementshell

    New-QADComputer -proxy -Name <Name of the new computer> -ParentContainer "<OU-Copied the distinguishedName of an earlier computer object from the AD>" -ObjectAttributes @{edsajoincomputertodomain='domain\userID'}

    Save this file in some convenient folder and then launch it like this (you can put this into a .CMD file):

    Powershell.exe -executionpolicy bypass -File  C:\<folder>\MyScript.ps1

    Keep in mind that in order for this to work, you must have been granted permissions in Active Roles to create computers.

  • Getting the below error.

    PS C:\> import-module activerolesmanagementshell


    WARNING: The names of some imported commands from the module 'activerolesmanagementshell' include unapproved verbs that
    might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again
    with the Verbose parameter. For a list of approved verbs, type Get-Verb.


    PS C:\> Get-Verb import-module activerolesmanagementshell
    Get-Verb : A positional parameter cannot be found that accepts argument 'activerolesmanagementshell'.
    At line:1 char:1

    + Get-Verb import-module activerolesmanagementshell
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-Verb], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Get-Verb

  • From what I can see, the import-module worked.  That message you received from it is normal and can be ignored.  Nothing to see here - move along.  Slight smile

  • How can we ignore this?. How do I get Proxy information?

  • Here's a typical implementation

    # Connect to your ActiveRoles server

    $MyARSession = Connect-QADService -Service myarserver.mydomain.com -proxy

    # Create the computer account

    New-QADComputer -Connection $MyARSession -Name "NewComputerName" -ParentContainer "mydomain.com/MyComputerOU"