locked
Powershell to AD RRS feed

  • Question

  • Hello,

    I am trying to use the script from http://powershell.com/cs/forums/t/15241.aspx I am using commands from Quest...

    [PS] H:\>$Users = Get-Content 'C:\Temp\User.txt'
    [PS] H:\>$results = @()
    [PS] H:\>Foreach($User in $Users)
    >> {
    >> $result +=Get-QADUser -Identity $User | select displayname,Samaccountname
    >> }
    >> $result| Export-Csv C:\Temp\Test12.csv -notype
    >>

    but the file Test12.csv is even not created I have no error...

    the file User.txt looks like:

    Users
    LastName1, FirstName1
    LastName2, FirtsName2
    LastName3, FirstName3
    etc...

    I tried also:

    [PS] H:\>Get-Content C:\Temp\User.txt | ForEach-Object { Get-QADUser -Filter {DisplayName -eq $_} -Properties DisplayNam
    e | Select-Object Name, DisplayName } | Export-Csv C:\Temp\file.csv -NoTypeInformation

    but got an error:

    Get-QADUser : A parameter cannot be found that matches parameter name 'Filter'.
    At line:1 char:68
    + Get-Content C:\Temp\User.txt | ForEach-Object { Get-QADUser -Filter <<<<  {DisplayName -eq $_} -Properties DisplayNam
    e | Select-Object Name, DisplayName } | Export-Csv C:\Temp\file.csv -NoTypeInformation
        + CategoryInfo          : InvalidArgument: (:) [Get-QADUser], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.GetUserC
       mdlet
    

    any idea?

    Thanks,

    Dom


    System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager


    • Edited by Felyjos Monday, September 22, 2014 7:37 PM
    Monday, September 22, 2014 7:09 PM

Answers

  • You considered using CSVDE ?
    • Marked as answer by Felyjos Tuesday, September 23, 2014 4:12 PM
    Tuesday, September 23, 2014 4:07 PM
  • Nope as all our operators are using Quest commands I was trying to keep everything in the same way not to get confusion for them...when launching tasks...

    Get-QADUser 'LastName, FirstName' | Select-Object -expand memberof

    this command works well for one user I was trying to adapt it for a list of users...

    I am following on another thread now

    http://social.technet.microsoft.com/Forums/en-US/b7667a10-8b61-4328-b6e1-0868081cff6d/quest-report-on-users?forum=rms

    Thanks,

    Dom


    System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager



    • Edited by Felyjos Tuesday, September 23, 2014 4:12 PM
    • Marked as answer by Felyjos Tuesday, September 23, 2014 4:12 PM
    Tuesday, September 23, 2014 4:09 PM

All replies

  • ?bump?

    System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager

    Tuesday, September 23, 2014 4:04 PM
  • You considered using CSVDE ?
    • Marked as answer by Felyjos Tuesday, September 23, 2014 4:12 PM
    Tuesday, September 23, 2014 4:07 PM
  • Nope as all our operators are using Quest commands I was trying to keep everything in the same way not to get confusion for them...when launching tasks...

    Get-QADUser 'LastName, FirstName' | Select-Object -expand memberof

    this command works well for one user I was trying to adapt it for a list of users...

    I am following on another thread now

    http://social.technet.microsoft.com/Forums/en-US/b7667a10-8b61-4328-b6e1-0868081cff6d/quest-report-on-users?forum=rms

    Thanks,

    Dom


    System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager



    • Edited by Felyjos Tuesday, September 23, 2014 4:12 PM
    • Marked as answer by Felyjos Tuesday, September 23, 2014 4:12 PM
    Tuesday, September 23, 2014 4:09 PM