Powershell script to find number of major and minor version for a item

Is there a way to figure out to get the total major and minor version count for an item in powershell.
I can get the count on basis of following
“Item Versions” = $item.Versions.Count
but not sure how to get number of major and number of minor version for an item. Pls advice.
Thanks Basva

Hi Basva,
There might be an easier way, but this should work:
foreach($item in $list.Items)
$minor = 0
$major = 0
foreach($version in $item.Versions)
if($version.Level -eq "Draft")
$minor += 1
else #Assume Level must be Published
$major += 1
#The variables $minor and $major will now hold
#the correct number of versions for this item

Similar Messages

  • Major and Minor Versions in OBPM Deployment

    How do we identify and classify some process/project as a major and minor version while deploying a project/process onto Weblogic Enterprise Server using the Process Administrator?
    Is there a guide which says what is a major version and what is a minor version of the project/process?

    Hi,
    The only document I know is http://download.oracle.com/docs/cd/E13165_01/albsi/docs57/ALBPM55_57ProjectVersioningRules.pdf
    It is a bit old since is for 5.7 version of the product but I believe it has not changed in the new versions.
    HTH

  • Powershell script to count number of list and library items in site collection

    We are identifying large lists in our 2010 SP environment and I'm attempting to write code to output the total number of list items in a site collection.   I'm using the code below but it only displays column data for title and url. 
    What do I need to add so it can count the number of items in each sharepoint list and library? 
    Get-SPSite -WebApplication http://sharepoint -Limit All |
       Select -ExpandProperty AllWebs |
       Select -ExpandProperty Lists |
       Select ParentWebUrl, Title
    I'm referencing
    http://sharepointpromag.com/sharepoint/windows-powershell-scripts-sharepoint-info-files-pagesweb-parts

    Please find belwo script, it will iterarte through all the folder/Subfoder to get the item counts from all list and library, you can modify this script to run this at site collection scope:
    Note: save the script in .ps1 file and execute the script as described below to get log file, it will save the log file out.txt in seleted directory:
    e.g.PS D:\PowershellScripts> .\ListItemCount.ps1 > out.txt
    $SPWebApp = Get-SPWebApplication "http://weburl.com/"
    foreach ($SPSite in $SPWebApp.Sites)
    if ($SPSite -ne $null)
    foreach ($SPWeb in $SPSite.AllWebs)
    foreach ($list in $SPWeb.Lists)
    $ListURL = $SPWeb.url + "/" + $list.RootFolder.Url
    Write-Output $ListURL
    [Microsoft.SharePoint.SPQuery]$query = New-Object Microsoft.SharePoint.SPQuery
    #$query.Folder = fldr;
    #Recursive Scope....
    $query.ViewAttributes = "Scope='Recursive'"
    $allitems = $list.GetItems($query);
    $filecount = $allitems.Count;
    Write-Output " No of item: " $filecount
    if ($SPWeb -ne $null)
    $SPWeb.Dispose()
    if ($SPSite -ne $null)
    $SPSite.Dispose()
    You can update the code to get any specific list type item count, using if($list.BaseType -eq "DocumentLibrary") condition:
    if($list.BaseType -eq "DocumentLibrary")
    $ListURL = $SPWeb.url + "/" + $list.RootFolder.Url
    Write-Output $ListURL
    [Microsoft.SharePoint.SPQuery]$query = New-Object Microsoft.SharePoint.SPQuery
    #$query.Folder = fldr;
    #Recursive Scope....
    $query.ViewAttributes = "Scope='Recursive'"
    $allitems = $list.GetItems($query);
    $filecount = $allitems.Count;
    Write-Output " No of item: " $filecount
    if ($SPWeb -ne $null)
    $SPWeb.Dispose()
    If my contribution helps you, please click Mark As Answer on that post and Vote as Helpful
    Thanks, ShankarSingh

  • PowerShell script to find a string of characters in office documents in Doc Libraries and List Item attachments?

    Hi there,
    For SharePoint 2010 site - Does someone have the PowerShell script to find a string of characters in Office/Word/Excel/PDF documents in document libraries or the ones attached to List Items?
    Thanks so much in advance.

    Hi,
    According to your description, my understanding is that you want to find some specific string character in list items using PowerShell Command.
    $w = Get-SPWeb "http://devmy131"
    $l = $w.GetList("http://devmy131/lists/fieldslist");
    $i = $l.Items[0]["Title"].ToString();
    if ($i -like '*document*')
    Write-Host "Title contains document character" $i;
    More information:
    PowerShell -contains -like
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • PowerShell Script to Create a Contact Card and Enable Email Forwarding

    Exchange 2010
    Can anyone help with creating a powershell script to create a contact card and set email forwarding at the sametime?
    I'm looking to import a list of 200 users via a text or csv file, create the contact card with first name, middle initial if one exists, last name, (no alias) and put the contact card in the following OU "DIS###" in the a.b.c.com domain as well
    as enable forwarding to @mail.com.
    I've been able to create a script to enable mail forwarding but it doesn't help me without a contact card.  I hate to put this upon anyone, but my ps scripting and Exchange knowledge is still in it's infant stage and I need get this done post haste

    Q:Import csv: Does this contain 200 mailboxes name
    A:It contains 200 user logon names.
    For the mail forwarding:
    I currently have a csv file with two columns -- one named displayname and the next call mailaddress.  Under the displayname column I have the users account name (first.mi.last -- middle initial if they have one) and under mailaddress i have @mail.com.                                                                                                           
    script:                                                                                                                                                                    
    Import-CSV C:\setmailforwarding\mailforwarding.csv | foreach-Object{Get-Mailbox $_.displayname | set-Mailbox -forwardingAddress $_.mailaddress}
    The above script should work if the contact card has been created.  Obviously I need to create the card first.
    I don't have a script to set up the contact card as of yet -- I was hoping to get some help on that.
    Q:E-mail forwarding: Is this  from  mailboxes to mail contact, you will be creating
    A:Not really sure what you are asking.  I'm looking to create the contact card with a csv or txt file for first name, middle initial if one exists, last name, (no alias) and put the contact card in the following OU "DIS###" in the a.b.c.com domain as
    well as enable forwarding to @mail.com.  The users current email is @mail.1234.com and we will be migrating our mailboxes to another organization that uses @mail.com.  I will need to set forwarding in the interim until the migration is complete.
    Hope this helps.

  • How to find function module's and tables used for the particulat screen or TCODE?

    Hello Nation,
    I would like to know how to find the  function modules and tables used for the particular screen or TCODE or program.
    Example : I would like know the function module used in the program RDBGFT?
                     How can i find that?
    Thanks in advance ,Awaiting your reply.

    Make use of Find function  with the keyword "CALL FUNCTION".
    Make use of the same find function with the keyword "Select" to know the database tables used.
    Regards,
    Philip.

  • How to find unsued Transfer Rules and Data Sources for a Master Table...??

    How to find unsued Transfer Rules and Data Sources for a Master Table...?? My requirement is i need to delete those Transfer rules and Data Sources which are not in use

    Hi
    Go to manage of the Text or attirbute of the master data object, see what are being loaded daily from there and delete the remaining.
    Cheer
    Ans as expected, Please reward

  • How can I create a matrix question? Specifically, I need a question in table format that allows each respondent to list a number of events and then data for each event (date, location, number of participants, topics covered, etc.

    How can I create a matrix question? Specifically, I need a question in table format that allows each respondent to list a number of events and then data for each event (date, location, number of participants, topics covered, etc.

    Hi,
    Sorry, we do not support a matrix-question field.   Please try the multilines text field (where your participant can enter multiple lines in the input text box) and see if it works for you.
    Thanks,
    Lucia

  • Urgentpls : How to find the Oracle reports and forms version in Unix prompt

    Hi,
    How to find the Oracle reports and forms version in Unix prompt.
    Please give the steps
    Thanks

    I need to check the version of Oracle forms and reportsExample :$ frmcmp.sh -h | head -1
    Forms 10.1 (Form Compiler) Version 10.1.2.0.2 (Production)
    $ rwrun.sh 2>/dev/null | head -2 | tail -1
    Report Builder: Release 10.1.2.0.2 - Production on Wed Mar 10 11:17:55 2010
    $

  • How to find out the plants and storage location for a given company code

    hi
    How to find out the plants and storage location for a given company code

    Hi
    Check for Assignem,ent of Plant & compnay code in OX18
    & for Combination of Plant & Storage location in OX09
    The total org structure can be viewed in EC01 - Click on Structure  -> navigation
    & Continue, Click on the Compnay code & the wole structure can be viewed
    Thanks & Regards
    Kishore

  • Major and minor Functional difference between 4.6c and ecc 6 in SD module

    Hi Gurus,
    Will anyone will mail me doc or url that shows the Major and minor Functional difference between 4.6c and ecc 6 in SD module.  Mail me at [email protected]
      full points for helpful answer
      Regards,
    PV

    Hi,
    This website is very helpfull for version comparision, have a look at it.
    <a href="http://solutionbrowser.erp.sap.fmpmedia.com/">Compare_Versions</a>
    Cheers...
    Santosh

  • Changing Major and Minor ticks in OBI graphs

    Hi Experts,
    I have couple of questions:
    I need to change the major and minor ticks in the OBI graph. For example, my graph has minimum value as 0% and maximum value as 120%. And my interval of the graph should be 20%. Can you suggest how I can change the interval? Currently the interval is 24%. But I require it to be 20%.
    Any help here would be great.
    ChD

    This is no Suite... it's all over the place.
    Consistency, consistency, consistency!
    ps. Et cetero censeo... And further I think the scroll wheel should work in all panels and in all CS3 apps.

  • Major and minor increment printout

    I am new to Labview, only have a couple months experience using Labview 7.1.
    My application is to use ultrasound to inspect a component.  For every component inspected, an ultrasound wave chart is print out.  I define my Y axis max and min, also define Y axis major and minor increment as 20 and 4 respectively(see attached file).  However, the very first print out is not what I defined.  It always the major is 10 and minor is 2.5 but the Y axis max and min are still correct.  For the second print out and there after.  They are all correct.  Did I miss something here?
    Any help si appreciated, thank you.
    Tony

    sorry, I missed the attached file.
    Attachments:
    LV_question.JPG ‏6 KB

  • What is the major differences between 6.5 and 11 version for essabes?

    Hi all,
    Can anyone list me out the differences between essabase 6.4 and 11 version for essabe?
    Thanks
    hari

    ASO
    If you want differences, have a a look at overview tool which will tell you the difference from 9.3 onwards :- https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=1092114.1
    Otherwise check the documentation for the new feature sections :- https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=1092114.1
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Onhand and available quantities for an item?

    Hi ALL,
    I have an item number with me..... how can I find available and onhand quantities for this item?
    Can someone please share the queries if you have or guide me how to get available and onhand quantities?
    and
    Can anyone let me know how available and onhand quantities are populated in SubInventory Transfer form?

    Dear Friend
    In OPM Inventory, go to Adjust immediate with this Item number, where you can see the available On hand quantity or You can use Item Inquiry form wherein you can also view the available on hand qty.
    (N): OPM Inventory-->Adjust immediate
    or
    OPM Inventory--> Set up--> Item Inquiry
    Regards
    Raj
    Sierra

Maybe you are looking for

  • Regarding Data Template Issue

    HI All, I am using the Data Template to publish output. Based on Data Template.xdo <?xml version = '1.0' encoding = 'utf-8'?> <report version="1.1" xmlns="http://xmlns.oracle.com/oxp/xmlp" defaultDataSourceRef="CNE1"> <title>Based on Data Template</t

  • Problem wrt54g3g configuration mode bridge or transparent

    hi, I have a router wrt54g3g with firmare 2.0.22, I want if can configure mode bridge this router, using the card vodafone 3G, why behind router I have linux server with firewall, vpn and web to filter. Thank you. 

  • Video input via USB?

    I know I can't input to iMovie via USB. But I have a Pinnacle analog to USB video converter/adapter that I'd like to use to import video from VHS tapes to mac. The Mac doesn't seem to recognize the signal. Is there a way to manually select the source

  • Tamil character "க" in missing in Tamil99 supplied with Mac OS X 10.5

    Hi, I want to use Tamil99 to write in Tamil language. But when i try to do that, i found that the character "க" is missing. If type "க" it shows "ஹ" instead. I try to check in the keyboard viewer there i can see "ஹ" character assigned to two key. Is

  • Bridge CS5 won't let me create Smart Collection

    Hi all - I am working with CS5 on a PC (Windows 7 Professional/64-bit) and Bridge will not allow me to create a Smart Collection. We want to use Bridge to sort graphics based on the type of graphic they are. We added keywords to the files and can use