none
Reboot all computer is OU at TIME RRS feed

  • Question

  • Can someone tell me why this is failing (and how to fix it)??

    Get-ADComputer -Filter * -SearchBase "OU=Test, OU=Hanger,OU=Planes Computers,DC=notmydomain,DC=com" |restart-computer $_.name

    I have confirmed the first part works.  As a minor side question, how could I get the first part to output only the name with no title like "BOB" and not "Name: BOB"

    Thanks for your help!!!


    BlankMonkey

    • Moved by EugeneLeitanMVP Tuesday, September 13, 2016 5:53 AM it isn't about the SCDPM
    Monday, September 12, 2016 2:40 PM

Answers

  • Get-ADComputer -Filter * -SearchBase "OU=Test, OU=Hanger,OU=Planes Computers,DC=notmydomain,DC=com" |
         ForEach-Object{ restart-computer $_.name }

    \_(ツ)_/

    • Proposed as answer by Vincent Karunaidas Tuesday, September 13, 2016 6:47 AM
    • Marked as answer by BlankMonkey Wednesday, September 14, 2016 3:54 PM
    Tuesday, September 13, 2016 6:37 AM
  • As a minor side question, how could I get the first part to output only the name with no title like "BOB" and not "Name: BOB"

    Get-ADComputer -Filter * -SearchBase 'OU=Test,OU=Hanger,OU=Planes Computers,DC=notmydomain,DC=com' |
        Select-Object -ExpandProperty Name



    • Marked as answer by BlankMonkey Wednesday, September 14, 2016 3:54 PM
    Tuesday, September 13, 2016 12:10 PM

All replies

  • Get-ADComputer -Filter * -SearchBase "OU=Test, OU=Hanger,OU=Planes Computers,DC=notmydomain,DC=com" |
         ForEach-Object{ restart-computer $_.name }

    \_(ツ)_/

    • Proposed as answer by Vincent Karunaidas Tuesday, September 13, 2016 6:47 AM
    • Marked as answer by BlankMonkey Wednesday, September 14, 2016 3:54 PM
    Tuesday, September 13, 2016 6:37 AM
  • As a minor side question, how could I get the first part to output only the name with no title like "BOB" and not "Name: BOB"

    Get-ADComputer -Filter * -SearchBase 'OU=Test,OU=Hanger,OU=Planes Computers,DC=notmydomain,DC=com' |
        Select-Object -ExpandProperty Name



    • Marked as answer by BlankMonkey Wednesday, September 14, 2016 3:54 PM
    Tuesday, September 13, 2016 12:10 PM