How can I use the Get_ADgroup cmdlet to filter on specific groups?

I'm trying to extract the users from specific groups
Get-AdGroup -Filter {('Name -like "MyCo *Admin*"') -or (Name -like MyCo Helpdesk"')}
This works: Get-ADGroup -Filter 'Name -like "MyCo *Admin*"'
I  have an number of administrator groups and one with the name helpdesk, I'm trying to create a list of all the users in any  groups that have admin privledges.
I can run the command twice and export to csv and merge both lists, but would like to create a script that I can use regualrly and have one csv file when done.
Any suggestions would be appreciated
-Tom
Tom


So I figured out how to paste into the reply.Here is the rest of the code, I tried running it and got the error at the bottom. Get-AdGroup -Filter {("Name -like 'MyCo *Admin*'") -or ("Name -like 'MyCo Helpdesk'")} |
ForEach-Object{
$hash=@{GroupName=$_.Name;Member=''}
$_ | Get-ADGroupMember -ea 0 -recurs |
ForEach-Object{
$hash.Member=$_.Name
New-Object psObject -Property $hash
} |
sort groupname,member
Get-ADGroup : Error parsing query: '("Name -like 'MyCo *Admin*'") -or ("Name -like 'MyCo Helpdesk'")' Error Message: 'syntax error' at position: '2'.
At line:1 char:12
+ Get-AdGroup <<<< -Filter {("Name -like 'MyCo *Admin*'") -or ("Name -like 'MyCo Helpdesk'")} |
+ CategoryInfo : ParserError: (:) [Get-ADGroup], ADFilterParsingException
+ FullyQualifiedErrorId : Error parsing query: '("Name -like 'MyCo *Admin*'") -or ("Name -like 'MyCo Helpdesk'")' Error Message: 'syntax error' at position: '2'.,Microsoft.ActiveDire
ctory.Management.Commands.GetADGroup
Tom

Similar Messages

  • How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    Did you check the help page for Correct Camera Distortion and Process multiple file
    Correct Camera Distortion: http://helpx.adobe.com/photoshop-elements/using/retouching-correcting.html#main-pars_headi ng_5
    Process multiple files: http://help.adobe.com/en_US/photoshopelements/using/WS287f927bd30d4b1f89cffc612e28adab65-7 fff.html#WS287f927bd30d4b1f89cffc612e28adab65-7ff6

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

  • How can I use the print module to print different size images on one large "canvas"?

    How can I use the print module to print different size images on one large "canvas"? An example would be in Photoshop, go to file>new, and create the size paper I want, and move images of different sizes onto it.
    I was thinking the print module would do this automatically for me.

    You can't, at present. It's been a requested feature, so we'll see if it shows up in a future version, but it's not there at present.

  • How can I use the QR codes with my iPad 2. do I need to download first an app ?

    How can I use the/read the QR codes with my iPad 2 ? Do I need to download an app ?

    Yes.  There are quite a few available for free in the app store

  • I have an Apple MacBook Pro with 2 USB ports and a MiniDisplay Port. I also have an HDTV with a HDMI port. How can I use the TV as a display without any tethering wires between my computer and the TV?

    I have an Apple MacBook Pro with 2 USB ports and a MiniDisplay Port. I also have an HDTV with a HDMI port. How can I use the TV as a display without any tethering wires between my computer and the TV? I have a MiniDisplay Port to VGA adapter, but there are two issues with it: The new display doesn't have a VGA port, and even if it did, I wouldn't want to have my mac constantly attached to the display by a cable. I was looking for a way to use the TV as a display without any wires. Is there some type of bluetooth setup I could use? Please let me know if you have any suggestions.

    As I wrote above, I think you should look into the Apple TV yourself. The best place to find information about what it can and can't do and to ask your own specific questions is probably in the Apple TV forum, here:
    https://discussions.apple.com/community/appletv/appletv

  • HT4314 I have a game under one account, now I have an Itunes card under a different account, how can I use the $$$ in the card for the game I'm playing, I need to purchase different items for my game.

    I have been playing a game for a while under an account, now I have an Itunes card under a different account and would like to use that $$$ to purchase items for my game, but it doesn't let me because the game was downloaded under the original account. How can I use the $$$ in my new account?

    same here but i cant purchase a movie or anything

  • How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?

    With Acrobat 6.0 I was able to copy a stamp in the same position (I mean "exactly" the same one) of different pages just by using the "copy/past" tool.
    Now I am using Acrobat XI and it seems like it is not possible anymore: I am copying a stamp and I am trying to past it in anoter page, but it appears in the center of the page (or wherever it wants to...).
    Does anyone have a solution?
    Thanks in advance.

    Thank you very much. I'll be waiting for you message.
    Messaggio originale----
    Da: [email protected]
    Data: 26/01/2015 17.56
    A: "Umberto Gangi"<[email protected]>
    Ogg:  How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?
        How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?
        created by Gilad D (try67) in Creating, Editing &amp; Exporting PDFs - View the full discussion
    Well, I was in the same situation so I've developed a tool that allows one to do it. I will send you some additional information about it in a private message.
         If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7132586#7132586 and clicking ‘Correct’ below the answer
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7132586#7132586
         To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, &amp; "Stop Following"
         Start a new discussion in Creating, Editing &amp; Exporting PDFs by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • I have two iphones, different telcos, i am using the same apple id for both - how can i use the 10GB icloud free memory of my new iphone 5?

    I have two iphones, different telcos, i am using the same apple id for both - how can i use the 10GB icloud free memory of my new iphone 5?

    Thank you KiltedTim!
    YES, that is the free 5GB icloud memory for each apple ID. Can I not add the free 5Gb of my second Iphone to my original apple ID (5GB also) as I want to use one Apple ID name on both 2 Iphones? Is it necessary to have a different apple ID for the second Iphone to avail the free 5GB it carries with it?

  • How can i use the iCloud

    how can i use the iCloud,i can't find the icon which should need i download

    system preferences - internet & wireless section - iCloud

  • I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    Contacts are designed to be synced to a supported application on the computer or a cloud service.
    Pictures taken with the device are designed to regularly be copied off the device to a computer as would be done with any digital camera.
    If you have failed to use the device as designed it may be too late to recovery anything.
    Is the device regularly backed up to a computer via iTunes?  If so, the most recent backup (when restored to a replacement iOS device) should contain all contacts and pictures as of when the backup was created.

  • How can i use the apps i have downloaded on itunes

    how can i use the apps i have downloaded on itunes

    Apps downloaded through iTunes will only run on iOS devices such as iPhones, iPod Touch, and iPads. Plug your device into your computer, open iTunes, and click on it in the bar either at the top or the left side. Then, click apps at the top, and click install next to the app you want installed.
    If you are looking for apps to run on your Mac, you need to download them through the Mac App Store, not through iTunes.

  • How can I use the Gmail app on the Watch?

    I do not use the Mail app on any of my Apple devices.  How can I use the Gmail app on the Watch?

    Since Google has not added watch support to the gmail app, you don't. You should be able to get notifications, but at this time, there is no gmail app for the watch.

  • How can I use the Internet on my Iphone?Apple says they send an e-mail, but to Whom? I didn't receive an e-mail

    How can I use the Internet on MY I phone?

    Don't understand.
    Tap the Safari icon.  You will be on the internet.
    The iphone is designed to always have access to the internet.
    What exactly is your issue?

  • How can I use the built-in Isight camera with an external camera (usb/firewire) at the same time?

    How can I use the built-in Isight camera and an external video camera at the same time?
    I'm wanting to stream over Oovoo/Skype/etc. using 2 cameras.
    Thanks

    Simple question with a not so simple answer.
    (a) If you mean that you want to run multiple apps simultaneously using a different camera with each app, you may encounter computing power limitations.  Digital video is processor intensive.  The only way to know if your Mac can do this it to try it.  If the video does not work together but each app works when it it the only app running, you are likely overloading your Mac's ability to process and/or move all the required data in your data bus.  You can get a better indication of whether this is the case by watching your Activity Monitor utility while running the apps you want to use.
    (b) If you mean that you want to have more than one compatible camera connected to your Mac simultaneously for ease of changing between video sources, some, but not necessarily all, apps you are using to operate your camera(s) allow you to select between your cameras.
    How you select among connected cameras depends on which application you are using. Here is how camera selection works in a few examples:
    (1) For iChat, you can choose which iSight you use in the "Camera:" choices bar in iChat > Preferences... > Audio/Video that appears when more than one compatible camera is connected. Although your camera choices will be different, the choices bar will look something similar to the Preferences settings shown here:
    If you cannot see the "Camera" choices bar, your Mac is recognizing only one (or none) of your cameras. In that case, consider the suggestions fromhttp://support.apple.com/kb/HT2090 for iSight problems or refer to your other camera's documentation for help.
    This particular choices bar solution applies ONLY to iChat. Most other applications also have settings that allow you to choose which camera to use. However, they do not all work the same way.
    (2) For instance, iMovie HD's camera choice is NOT set via Preferences. When you have more than one compatible camera connected, iMovie6 HD uses a drop-down menu choice something like this (depending on which version of iMovie you use):
    Note: Because I had no built-in iSight connected when I made this example, and because my external iSight was not connected, the drop-down menu showed only "Time Lapse." Because your Mac has a built-in iSight, your built-in iSight would show in the drop-down menu even when no other camera is connected. Connecting an additional Mac compatible webcam should allow you to choose either camera.
    Other iMovie versions work slightly differently.
    iMovie 9 (from iLife '11) uses a different camera choice button shown in this article:
      http://docs.info.apple.com/article.html?path=iMovie/9.0/en/mov39f84285.html
    iMovie 8 (from iLife '09) is slightly different as explained in this article:
      http://docs.info.apple.com/article.html?path=iMovie/8.0/en/10172.html
    In general, you can use your Mac's help for the application in use to find out how to select among more than one connected camera.
    (3) Photo Booth in Snow Leopard 10.6.x and later uses the Photo Booth > Camera menu command to select which camera to use.
    Note for readers with older Mac OS X: The previous version of Photo Booth that came with Tiger (10.4.x) is such a simple, basic app that it offers no menu selectable choice. Unless your built-in iSight is already occupied as the camera being used by some open application before you launch Photo Booth, Photo Booth will use ONLY your built-in iSight.
    However, you can use the trick from ¶ 4 of http://docs.info.apple.com/article.html?artnum=302781 to let Photo Booth use an external camera.
    (If you have an external Firewire camera connected, it may be used in preference to any USB webcam. If that is a problem for you, merely disconnect the problem Firewire device.)
    (4) For FaceTime, launch the app and click the Video menu item.
    If your Mac recognizes more than one connected compatible camera, a "Camera" section listing the cameras from which you can choose will appear there. Clicking on the desired camera name will let you select the one you want as shown in this image from my Mac Pro and LED Cinema Display:
    If your Mac recognizes only one compatible camera, the "Camera" section will not appear in the Video menu, but FaceTime will automatically use the connected camera that is recognized by OS X.
    (5) I do not use Skype oir Oovoo.  For those or other apps, see Help for each app for info on how to select your desired camera.
    Message was edited by: EZ Jim

Maybe you are looking for