What are the PowerShell equivalents of these Quest cmdlets??

Welcome Forums General PowerShell Q&A What are the PowerShell equivalents of these Quest cmdlets??

This topic contains 4 replies, has 2 voices, and was last updated by

 
Participant
3 months, 1 week ago.

  • Author
    Posts
  • #156500

    Participant
    Topics: 22
    Replies: 58
    Points: -4
    Rank: Member

    I found a script on the interwebs with Quest cmdlets in it:

    if ($scope -eq "Computer") {
    foreach ($GroupMember in $GroupMembers) {
    $OU = Get-QADComputer $GroupMember
    New-GPLink -Name "$GPO" -Target $OU.ParentContainerDN -link Yes
     
    }
    }
     
    if ($scope -eq "User") {
    foreach ($GroupMember in $GroupMembers) {
    $OU = Get-QADUser $GroupMember
    New-GPLink -Name "$GPO" -Target $OU.ParentContainerDN -link Yes
    

    How can I write the code to use standard PowerShell instead??

    Source:
    Optimizing GPOs

  • #156506

    Senior Moderator
    Topics: 8
    Replies: 1008
    Points: 3,275
    Helping Hand
    Rank: Community Hero

    While searching for what you got this snippet ? To make the question more clear, What are you trying to achieve here ?

    finally, try removing QA from the quest cmdlets.

  • #156509

    Participant
    Topics: 22
    Replies: 58
    Points: -4
    Rank: Member

    I want to rewrite the script without using the QA cmdlets, using only standard PowerShell code.
    I'm not a PowerShell expert.
    I tried it with removing the QA on the commands but then get-adgroupmember wants an Identity...

  • #156512

    Senior Moderator
    Topics: 8
    Replies: 1008
    Points: 3,275
    Helping Hand
    Rank: Community Hero

    Yup, identity is a mandatory input. You can read the help document which will help you to achieve your goal.

    #Do a Get-Help for each cmdlet to get help/examples on how to use it. Below is how it will be for Get-AdGroupMember
    Get-Help Get-AdGroupMember -Online
    

    Once you read the docs, try to use the cmdlets as per the docs and see what you get and post here in case of any errors/blockers you face.

    • #156513

      Participant
      Topics: 22
      Replies: 58
      Points: -4
      Rank: Member

      Thank you, I think I will have to rewrite the whole script anyway.

The topic ‘What are the PowerShell equivalents of these Quest cmdlets??’ is closed to new replies.