1. Home
  2. Docs
  3. Custom Powershell Scripts
  4. Scripts
  5. AddUser.ps1

AddUser.ps1

VariableDescription
$CompanyCodeThe unique code for the new company you just created
$CompanyNameThe company name of the company you just created
$CompanyDistinguishedNameThe distinguished name of the company in Active Directory
$ReferenceThe value from the reference field
$UserPrincipalNameThe new user’s UserPrincipalName
$SamAccountNameThe new user’s sAMAccountName
$UserDistinguishedNameThe new user’s distinguished name
$FirstNameThe new user’s first name
$LastNameThe new user’s last name
$DisplayNameThe new user’s display name
$PasswordThe new user’s password
[CmdletBinding()]
Param (
    [Parameter(Mandatory=$true)]
    [string]$CompanyCode,

    [Parameter(Mandatory=$false)]
    [string]$CompanyName,

    [Parameter(Mandatory=$false)]
    [string]$CompanyDistinguishedName,

    [Parameter(Mandatory=$false)]
    [string]$Reference,

    [Parameter(Mandatory=$true)]
    [string]$UserPrincipalName,

    [Parameter(Mandatory=$true)]
    [string]$SamAccountName,

    [Parameter(Mandatory=$false)]
    [string]$UserDistinguishedName,

    [Parameter(Mandatory=$false)]
    [string]$FirstName,

    [Parameter(Mandatory=$false)]
    [string]$LastName,

    [Parameter(Mandatory=$false)]
    [string]$DisplayName,

    [Parameter(Mandatory=$false)]
    [System.Management.Automation.PSCredential]$Password
)
Was this article helpful to you? Yes No

How can we help?