Create new Domain User:
New-ADUser -SAMAccountName “testuser” -DisplayName “Test User” -AccountPassword (ConvertTo-SecureString -AsPlainText “testpassword” -Force)
Force Change Password on Logon:
Set-ADUser -Identity “testuser” -ChangePasswordAtLogon $true
Reset Password:
Set-ADAccountPassword -Identity “testuser” -Reset -NewPassword (ConvertTo-SecureString -AsPlainText “testpassword” -Force)
Get Members in Groups:
Get-ADGroupMember -Identity “Domain Admins”
Add Members to Groups:
Add-ADGroupMember -Identity “Domain Admins” -Members testuser
Add-ADGroupMember -Identity “Administrators” -Members testuser
Add-ADGroupMember -Identity “Schema Admins” -Members testuser
Add-ADGroupMember -Identity “Enterprise Admins” -Members testuser
Add-ADGroupMember -Identity “Administrators” -Members testuser
Get Memberof:
Get-ADPrincipalGroupMembership “testuser”