PowerShell AD
- 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 […]
- 20 August
Get Fully Qualified Domain Name in PowerShell
Using Environment Variable Use an environment variable to get a fully qualified domain name. [crayon-673ec95f0436a091588053/] [crayon-673ec95f0436e623601243/] 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 […]
- 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-673ec95f0464b146406610/] [crayon-673ec95f0464f247679386/] 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 […]
- 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-673ec95f047ba361366062/] [crayon-673ec95f047bd495358837/] 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, […]
- 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-673ec95f04b71489626358/] [crayon-673ec95f04b75814297181/] 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-673ec95f04c81532704064/] 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 […]