none
Disable multiple user as per the csv and add comments in description RRS feed

  • Question

  • Dear Team,

    I want to disabled multiple user and add on comments in that users.

    Please suggest .

    Yogee 

    Wednesday, June 26, 2019 10:13 PM

All replies

  • Try this:
    Import-Csv <PATH> | foreach{
    
    Set-ADUser $_.User -Description "Some Description"
    Disable-ADAccount -Identity $_.User 
    
    }
    
    

    $_.User is used considering that the 'User' is the column header in the csv.
    Wednesday, June 26, 2019 10:25 PM
  • Try this:
    Import-Csv <PATH> | foreach{
    
    Set-ADUser $_.User -Description "Some Description"
    Disable-ADAccount -Identity $_.User 
    
    }
    

    $_.User is used considering that the 'User' is the column header in the csv.

    Friday, June 28, 2019 1:17 PM