Thursday 4 August 2022

PowerShell Quick and dirty add a user to AD

New-ADUser <USERNAME>
Set-ADAccountPassword <USERNAME> -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "<PASSWORD>" -Force -Verbose) -PassThru
Add-ADGroupMember -Identity "<GROUPNAME>" -Members <USERNAME>
enable-adaccount -identity "<USERNAME>"

No comments:

Post a Comment