![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Quest AD Cmdlet as part of a script I've tried the QuestADCmdlet in script below and got to grips running them from the PS CMD line, however, when included as part of a script - see as follows - the cmdlet doesn't seem to run (the csv files named by groupname are crtaed fine - they are just not populated with anything - Any help would be greatly appreciated: $Membersfile = 'D:\Groups\members.csv' #import the input file of groups $IGroups = Import-Csv 'D:\Groups\groups.csv' $OriginalGroup = $IGroup Foreach($IGroup in $IGroups) { $G = $IGroup.group $Membersfile = 'D:\Groups\'+$G+'.csv' function get-members{ param($G) $members = Get-QADGroupMember -Identity $G -indirect $strOutputString = "$members" $strOutputString | out-file -filepath $Membersfile -encoding ascii -append } get-members } -- jobbsy@xxxxxx |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Quest AD Cmdlet as part of a script In the script try adding the snapin add-pssnapin Quest.ActiveRoles.ADManagement -ea 0 Brandon Shell [MVP] ------------------------ Blog: http://www.bsonposh.com/ Author: http://www.TurboChargeAD.org Profile: https://mvp.support.microsoft.com/profile/Brandon J> I've tried the QuestADCmdlet in script below and got to grips running J> them from the PS CMD line, however, when included as part of a script J> - see as follows - the cmdlet doesn't seem to run (the csv files J> named by groupname are crtaed fine - they are just not populated with J> anything - Any help would be greatly appreciated: J> J> $Membersfile = 'D:\Groups\members.csv' J> J> #import the input file of groups J> $IGroups = Import-Csv 'D:\Groups\groups.csv' J> $OriginalGroup = $IGroup J> J> Foreach($IGroup in $IGroups) { J> J> $G = $IGroup.group J> J> $Membersfile = 'D:\Groups\'+$G+'.csv' J> J> function get-members{ J> param($G) J> $members = Get-QADGroupMember -Identity $G -indirect J> $strOutputString = "$members" J> $strOutputString | out-file -filepath $Membersfile -encoding ascii J> -append J> } J> J> get-members J> } |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Quest AD cmdlet -what is the cmdlet to remove computer object | PowerShell | |||
| quest cmdlet : get-qadcomputer | PowerShell | |||
| Registering a Script CmdLet? | PowerShell | |||
| Script Cmdlet Bug? | PowerShell | |||
| Re: Using a colon in a script to call another cmdlet | PowerShell | |||