PS-script that can list all clients in a specific collection and if possible, point out direct members...

CM2012Sp1Cu1 
Need a powershell-function that can list all the clients in a specific collection, and then somehow define which of them are direct members. The most important thing for me is to list all the members but it would also be great if I could know which ones are
direct / query members. 
Very grateful for all the help I can get!
TWP

Here is a very simple example via PowerShell and WMI. It requires your collection id, site code and site server as input. It writes as output the collectionmember plus query, or direct.
$CollectionId = ""
$SiteCode = ""
$SiteServer = ""
$CollectionMembers = Get-WmiObject -Class SMS_FullCollectionMembership -Namespace root/SMS/site_$($SiteCode) -ComputerName $SiteServer -Filter "CollectionId='$CollectionId'"
foreach ($Member in $CollectionMembers) {
if ($Collection.IsDirect -eq "True"){
$MembershipType = "Direct"
} else {
$MembershipType = "Query"
Write-Host $Member.Name $MembershipType
My Blog: http://www.petervanderwoude.nl/
Follow me on twitter: pvanderwoude

Similar Messages

  • Request - Perl script that can parse an ACE config from a VIP

    Has anyone ever written a Perl script that can take the VIP from an ACE config and parse it out into the component parts of the config, ACLs, NATs, Class-map, policy-map, etc. ?
    This seems like something someone must have written already.
    Thanks in advance!

    Any reason you dont want to use XML instead of doing just PERL ?  Its lot easier to do with XML scripts as ACE has a XML interface to query whatever is needed. So that said, you can use a perl to interface ACE via XML. Here's a simple Perl that uses LibCurl:
    #!/usr/bin/perl
    use WWW::Curl::Easy;
    my $numArgs = $#ARGV + 1;
    if ($numArgs<4)
    die("Usage: shusers.pl ip_address username password command\n");
    my $ip = @ARGV[0];
    my $uname = @ARGV[1];
    my $pwd = @ARGV[2];
    my $cmd = @ARGV[3];
    my $curl = new WWW::Curl::Easy;
    my $posturl = "http://$ip/bin/xml_agent/";
    my $xml_cmd = "xml_cmd=<$cmd/>";
    $curl->setopt(CURLOPT_HEADER, 0);
    $curl->setopt(CURLOPT_FRESH_CONNECT, 1);
    $curl->setopt(CURLOPT_URL, $posturl);
    $curl->setopt(CURLOPT_RETURNTRANSFER,1);
    $curl->setopt(CURLOPT_USERPWD,"$uname:$pwd");
    $curl->setopt(CURLOPT_POST,1);
    $curl->setopt(CURLOPT_POSTFIELDS, $xml_cmd);
    $curl->perform;
    my $info = $curl->getinfo(CURLINFO_RESPONSE_CODE);
    print $info;
    Hope this helps.
    Cheers
    V.K

  • In need of a report that will list all vendors for all parts in our plant.

    Can anyone tell me if there is a report in SAP that we can use to list all suppliers for a given material? We are operating in SAP ECC6.0 and need a report that will list all vendors that the company has used for a given part. Is there a standard report in SAP that pulls information from purchasing info records?  Woud this be  a custom report?     I have tried using MCE3. 
    Also does anybody know of any SAP consultants that can help us create custom reports

    For the list of vendors for the material - Me03 if source list is maintained
    For list of vendors with info record - Me1m
    For list of vendors with PO - Me2l
    If you can give the correct requirements then your Technical consultant will develop a report in the required format.

  • HELP:script that iterates through all opened documents and rezise them to match the biggest one.

    Hi,
    I'm making a batch processing action and I really need a script that iterates through all open documents, finds the one with the biggest image size and then iterates one more time to change the rest of the documents to the same image size dimensions. At the end all documents must share identical image size.  I'll really  appreciate if someone can put a quick script for doing this. Thank you !

    I think should do…
    #target photoshop
    if (documents.length > 1) {
         var smallest = 1000000; // Set beyond any size you may be expecting this should do?
         for (var a = 0; a < documents.length; a++) {
              smallest = Math.min(smallest,documents[a].width.as('px'));
         for (var b = 0; b < documents.length; b++) {
              if (documents[b].width.as('px') != smallest) {
                   app.activeDocument = documents[b];
                   var newWidth = new UnitValue(smallest, 'px');
                   documents[b].resizeImage(newWidth,undefined,undefined,ResampleMethod.BICUBICSMOOTHER);
    }else{
         alert("NOT enough docs to resize?");

  • Are there any command can list all container and XML doc which in DB

    When I use BDB XML shell,
    are there any command can list all container or xml document which in database,
    maybe like command dir(in windows), can list all exist directory and file.
    Thank very much.
    Henry Wang

    Hi Henry,
    When I use BDB XML shell,
    are there any command can list all container or xml
    document which in database,
    maybe like command dir(in windows), can list all
    exist directory and file.If you type "help" in the dbxml shell you'll get a list of all the commands available. As you will observe, you can use the "getDocuments" command to retrieve all the documents within a container. You will have to open the container first.
    If you want to list all the files within a directory you'll need to simply use the command prompt's "dir" (naming all your containers within a directory in the <container_name.dbxml> would allow you get the list by running a "dir *.dbxml" command).
    Not sure that this is what you really want, but if you would like to keep track of all the containers within a directory, or other directories, you can use a container with a special role, that of a catalogue, to hold the list of all created containers on disk, and eventually other specific information.
    Regards,
    Andrei

  • I want to know how to create a new script that can be run in batch proces in Photoshop Element 11 ?

    I want to know how to create a new script that can be run in batch proces in Photoshop Element 11 ?

    Have a look at the menu file/process multiple files. You can choose to add your signature (or the caption) to the image and export the new files.
    If that solution is not flexible enough, consider using the very affordable (12$)  Elements+ add-on which offers a 'meta stamp' script :
    http://elementsplus.net/v5/en/meta-stamp.htm
    Otherwise, have a look at other free and good solutions like Faststone Photoresizer, Xnview...

  • Java Code  that can find all the specified functions in a sql statement

    If i pass a string like
    SELECT CONCAT(region_name,store_name) , length( region_name) , region_name || store_name, region_name, store_name FROM Geography
    WHERE store_name = 'Boston';
    Then my code should return
    CONCAT(region_name,store_name)
    length( region_name)
    region_name || store_name
    i.e all function related stuff. Is there any parser in java that can parse all the functions a sql or ny code that can d that. Any help is highly appreciated

    I suspect a regular expression may be able to handle this, or 'grep'. Why do you need to do it in Java?

  • A script that can be used to track text content changes in indesign?

    Is there a possibility a script that can be used to track text content changes in indesign. My Indesign software's version is CS3. As you can see below, I have deleted some texts and added some. I did it in another software.
    I have been searched for a long time. Because of my poor English, I still can't come up with any Object Model related to the script yet.
    Here is some idea of mine:
    Use the script tracking my revising texts. When I  add some new texts, the texts will be underlined. When I delete some texts, the position of the first character of the removed text will be added a small red triangle or something.
    Thanks in advance.

    Hidden dragon, what does that mean?
    I can't comprehend fully what you said.
    Is IDML short for Indeisgn Markup Language?
    I think you are telling me that I can open the Indeisgn document by using the software InCopy. Then I have change some contents. InCopy will help me tracking the revision.
    getZinger. Do I get your point?

  • List all clients connected in a FlexSession

    Is possible list all clients connected in a FlexSession?
    Does anyone have a link or example to share?
    Sorry for bad English....
    I´m using FlexBuilder 4.6 and Java

    Seems like a good homework assignment.
    Thanks for sharing.
    Did you have a question about this?
    How much have you done so far?
    Dave Patterson

  • Hey guys, i need HELP !!!My iphone 6 just gave stolen .... But i hope that can take all the photo back... Total is almost 3000 pc ... But my icloud storage just 5gb only ... If there have any ways to let me get back those photo ? Those photo really m

    Hey guys, i need HELP !!!My iphone 6 just gave stolen .... But i hope that can take all the photo back... Total is almost 3000 pc ... But my icloud storage just 5gb only ... If there have any ways to let me get back those photo ? Those photo really mean a lot to me .... Have alot of memory with family ... It's very meaningful !!! Please kindly help me !!! Thanks           

    Please please help me, if you know how.

  • What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?

    What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?
    a. PowerShell
    b. isql
    c. osql
    d. sqlcmd

    All questions seem to be from the interview or a test. I think I even took this test once, it's KForce test.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Anyone know of a good IOS app that can play all media files across a home network, file share on a NAS or Windows PC??

    anyone know of a good IOS app that can play all media files, MKV, AVI, Xvid with subtitles across a home network, file share on a NAS or Windows PC?? I know I have BS player free for android, works pretty good on my nexus tablet.  is there a good IOS one that anyone can think of that can browse the network?
    or do I have to run transcoders?
    I store some files on the windows PC and some files on a linux NAS that the windows PC maps to

    I'm sorry to hear that.
    I'm not affiliated w/ the developer, just a happy user that gave up fighting the apple podcast app a while ago.  I used to have a bunch of smart playlists in itunes for my podcasts, and come home every day and pathologically synced my phone as soon as I walked in the door, and again before I walked out the door in the morning.
    Since my wife was doing this too, we were fighting over who's turn it was to sync their phone.
    Since I've switched to Downcast, I no longer worry about syncing my phone to itunes at all.  I can go weeks between syncs.
    Setup a "playlist" in downcast (ex., "Commute") and add podcasts to that playlist.  Add another playlist ("walk" or "workout") and add different podcasts to that one. 
    Set podcast priorities on a per-feed basis (ex., high priority for some daily news feeds, medium priority for some favorite podcasts, lower priority for other stuff).  Downcast will play the things in the priority you specify, and within that priority, it will play in date order (oldest to newest).
    Allegedly, it will also sync your play status to other devices, although that is not a feature I currently use and can't vouch for.  It uses apple's iCloud APIs, so to some extent may be limited by what Apple's APIs can do.

  • There's an odd folder on the desktop labeled 8041A210 that can't be deleted. What is it and how do I get rid of it?

    There's an odd folder on the desktop labeled 8041A210 that can't be deleted. What is it and how do I get rid of it?

      Oh, I don't think so.   But it's amazing how many problems get solved via Google.  Thanks for the star, enjoy your evening.

  • A toolbar called Searchqu got installed in my web browsers.I uninstalled Mozilla Firefox without removing the toolbar and it stopped working saying that can't connect to the server.I uninstalled and installed Firefox but it isn't working.

    A toolbar called Searchqu got installed in my web browsers.I uninstalled Mozilla Firefox without removing the toolbar and it stopped working saying that can’t connect to the server.I uninstalled and installed Firefox but it isn’t working.

    See this thread for potential ways of removing Searchqu from your system: https://support.mozilla.com/en-US/questions/790833

  • Yesterday i buy used iphone 4 from my friend i want to know that can i checked online or on internet status and history of this mobile ? that it is no

    yesterday i buy used iphone 4 from my friend i want to know that can i checked online or on internet status and history of this mobile ? that it is no

    https://selfsolve.apple.com/agreementWarrantyDynamic.do

Maybe you are looking for