• PowerShell get password policy for user in active directory
    20 August

    Get Password Policy for User in Active Directory in PowerShell

    Using Get-ADDefaultDomainPasswordPolicy Cmdlet The Get-ADDefaultDomainPasswordPolicy is used to get the default password policy for the specified domain. We can use it differently in different use cases; let’s learn a few of them below. Use the Get-ADDefaultDomainPasswordPolicy cmdlet with the -Current parameter to get the default password policy for the currently logged-on user in an active […]

  • PowerShell get fully qualified domain name
    20 August

    Get Fully Qualified Domain Name in PowerShell

    Using Environment Variable Use an environment variable to get a fully qualified domain name. [crayon-662dfa3a5e184998983630/] [crayon-662dfa3a5e18b481708679/] First, we assigned the value of the environment variable ($evn:COMPUTERNAME) to the $computer_name variable. The environment variable COMPUTERNAME stored the current computer’s name or you can say the current host’s name; both meaning the same. Then, we assigned the […]

  • PowerShell get password expiration date
    16 August

    Get Password Expiration Date in PowerShell

    Using Get-ADUser Cmdlet Use the Get-ADUser cmdlet to get the password expiration date for one specific user in an Active Directory. [crayon-662dfa3a5e427096030100/] [crayon-662dfa3a5e42b489731260/] The Get-ADUser cmdlet is used to get one or multiple users from an active directory. We used it with the -Identity parameter to only get the Administrator user with SamAccountName and msDS-UserPasswordExpiryTimeComputed […]

  • PowerShell get ad user home directory and home drive
    16 August

    Get AD User Home Directory and Home Drive in PowerShell

    Using Get-ADUser Cmdlet We use Get-ADUser differently based on various use cases; let’s explore a few of them below. Get Home Directory & Drive for One User Use the Get-ADUser cmdlet to get the ad user’s home directory and home drive. [crayon-662dfa3a5e570661849718/] [crayon-662dfa3a5e573268856473/] First, we initialized the $username variable with the Administrator; this was the […]

  • 04 May

    Check if AD User Exists in PowerShell

    In PowerShell, we must import the ActiveDirectory module to use the Get-ADUser cmdlet. If you have imported it already, you can jump to the Checking If AD User Exists in PowerShell section; otherwise, let’s continue with us step-by-step below. Installing the ActiveDirectory Module To import the ActiveDirectory module, we first need to install it. So, […]

  • PowerShell get ad user account expiration date
    15 April

    PowerShell Get Ad User Account Expiration Date

    Using Get-AdUser Cmdlet with Select-object cmtlet Use the Get-AdUser with Select-object to get the ad user account expiration date in PowerShell. [crayon-662dfa3a5fe46830529104/] [crayon-662dfa3a5fe50727665589/] Here, the PowerShell cmdlet Get-ADUser was used to retrieve the information about the users of the Active Directory as it is a centralized system. Now, what is Active Directory? Microsoft provides directory […]

  • 24 December

    Get AD User Description in PowerShell

    To get AD user description in powerShell, use Get-AdUser cmdlet with -Properties as Description. [crayon-662dfa3a6003d869013946/] Please note that you must must first install the Remote Server Administration Tools (RSAT) package and import the Active Directory module. Get AD User Description and Attributes in PowerShell The Get-ADUser cmdlet is a powerful tool in the Active Directory […]