none
I want to see... RRS feed

  • Question

  • Hi there!

    I'm adding users to groups with this script:
    Import-CSV ".\users.csv" | % {Add-ADGroupMember -Identity BadGuys  -Member $_.SamAccountName}

    But everything happens in the background. How can I tell PS to show me ".. adding user DD001..done!" or something like that?

    \Emilio

    Tuesday, April 14, 2015 1:10 PM

Answers

  • Hi. I have tried to add -verbose attribute to add-adgroupmember, but it was not very useful.

    Anyway you can try to do that by yourself

    Import-CSV ".\users.csv" | % {"Adding $($_.SamAccountName) to BadGuys..."; Add-ADGroupMember -Identity BadGuys  -Member $_.SamAccountName}


    ------- Michal Stoppl



    • Edited by MStoppl Tuesday, April 14, 2015 1:18 PM
    • Marked as answer by Emilio Cotroneo Tuesday, April 21, 2015 7:24 AM
    Tuesday, April 14, 2015 1:18 PM
  • Thanks for your answer Michal.
    I will try this solution asap.

    Have a nice day!

    \\Emilio

    Tuesday, April 21, 2015 7:32 AM

All replies

  • Hi. I have tried to add -verbose attribute to add-adgroupmember, but it was not very useful.

    Anyway you can try to do that by yourself

    Import-CSV ".\users.csv" | % {"Adding $($_.SamAccountName) to BadGuys..."; Add-ADGroupMember -Identity BadGuys  -Member $_.SamAccountName}


    ------- Michal Stoppl



    • Edited by MStoppl Tuesday, April 14, 2015 1:18 PM
    • Marked as answer by Emilio Cotroneo Tuesday, April 21, 2015 7:24 AM
    Tuesday, April 14, 2015 1:18 PM
  • Thanks for your answer Michal.
    I will try this solution asap.

    Have a nice day!

    \\Emilio

    Tuesday, April 21, 2015 7:32 AM