New-QADUser (Quest cmdlet)

Create a new user account.

Syntax
      New-QADUser [-Name] String [-ParentContainer IdentityParameter] ADProperties
         -UserPassword String [-AccountExpires Nullable] [-PasswordNeverExpires]
            [-UserMustChangePassword] TerminalServiceProperties
               [-UserPassword String] Advanced_Options
                  [-WhatIf] [-Confirm]

Key
   -identity    The Distinguished Name (DN), Canonical Name, GUID or, where applicable,
                the Domain\Name, UPN or SID of the object you wish to find. 

   -AccountExpires
                Set the account expiration date

   -PasswordNeverExpires
                Set to True to never expire the account password

   ADProperties
                Set object properties:
                [-Manager IdentityParameter] [-City String] [-Company String]
                [-Department String] [-Fax String] [-FirstName String]
                [-HomePhone String] [-Initials String]  [-LastName String]
                [-MobilePhone String] [-Notes String] [-Office String]
                [-Pager String] [-PhoneNumber String] [-PostalCode String]
                [-PostOfficeBox String] [-SamAccountName String] [-StateOrProvince String]
                [-StreetAddress String] [-Title String] [-UserPrincipalName String]
                [-WebPage String] 
                [-ProfilePath String] [-LogonScript String] [-Email String] ?
                [-Description String] [-DisplayName String] 

  Advanced_Options:
                [-ObjectAttributes ObjectAttributesParameter] 
                [-ExcludedProperties String[]] [-IncludedProperties String[]]
                [-DeserializeValues] [-UseDefaultExcludedProperties] 
                [-Proxy] [-UseGlobalCatalog] [-Service String]
                [-ConnectionAccount String] [-ConnectionPassword SecureString] 
                [-Credential PSCredential] [-Connection ArsConnection]

Notes:
By default New-QADUser will connect to any available domain controller with the credentials of the locally logged on user, to connect to a specific domain controller using a specific account, either use the advanced options (-Proxy/-Service/-ConnectionAccount) or use the Connect-QADService cmdlet to make the connection.

Examples

Create a user called 'user64'

PS C:> New-QADUser -name 'user64' -ParentContainer 'CN=Users,DC=SS64,DC=com' -samAccountName 'user64' -UserPassword 'Pass123'

Create a user called 'user65'

PS C:> $pass = read-host "Enter password" -AsSecureString

PS C:> New-QADUser -name 'user65' -ParentContainer 'CN=Users,DC=SS64,DC=com' -samAccountName 'user65' -UserPassword $pass

“Birth does not lead to greatness; but the cultivation of virtues by a person leads him to greatness” ~ Anon

Related:

PowerGui Wiki for New-QADUser
Get-QADUser - Retrieve users that match specific conditions
Set-QADUser
- Modify attributes of a user account


© Copyright SS64.com 1999-2014
Some rights reserved