Announcement

Collapse
No announcement yet.

Logging for User Add to Group List

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Logging for User Add to Group List

    Hello everyone. I have a script that I am using to add a list of users to a group. However, I am having trouble having it create a log. The script is as follows:

    ForEach ($Object in (Import-CSV 'Printers.csv')) { %{ Add-QADGroupMember $Object.'groups' -Member $Object.'member' } }

    The script runs as I expect, but I am just trying to get it to log. When I insert out-file in various sections of the code, it never seems to pipe any results. Optimally, I would love to have it log which were successful and which were not, but I would simply settle for just the successful ones at this point. Any help would be appreciated. Thanks.

  • #2
    Re: Logging for User Add to Group List

    Hi,

    Try with Tee-Object.
    Thanks & Regards
    v-2nas

    MCTS 2008, MCTIP, MCSE 2003, MCSA+Messaging E2K3, MCP, E2K7
    Sr. Wintel Eng. (Investment Bank)
    Independent IT Consultant and Architect
    Blog: http://www.exchadtech.blogspot.com

    Show your appreciation for my help by giving reputation points

    Comment

    Working...
    X