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

ResetPassword.ps1

VariableDescription
$CompanyCodeThe unique code for the company
$CompanyNameThe name of the company
$ReferenceThe reference for the company
$UserGuidThe user’s GUID in Active Directory
$UserPrincipalNameThe user’s UserPrincipalName
$SamAccountNameThe user’s sAMAccountName
$UserDistinguishedNameThe user’s distinguished name
$FirstNameThe user’s first name
$LastNameThe user’s last name
$DisplayNameThe user’s display name
$PasswordThe new password that was just s et
[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?