Forum Discussion

  • hkarthik_7's avatar
    hkarthik_7
    Copper Contributor

    Hi james_teach256, User accounts can be enabled with the SamAccountNames. You can place the SamAccountNames in a text file and execute the below script to enable the user accounts in bulk. Also, note that this should be executed from a domain controller. 

     

    Import-Module ActiveDirectory

     

    # Place all the SamAccountNames in a text file
    (Get-Content "C:\TEMP\ADUsers.txt") | ForEach-Object {
    Enable-ADAccount -Identity $_
    }

Resources