Creating a collection of recently built systems

Hello all,
I was wondering if anyone knows the query to use for identifying systems built within a certain time frame, such as the last hour / last 2 days etc. I would use the query to create a collection that would immediately install patches, instead of waiting for
the next maintenance window.
I thought about using the whenCreated time stamp attribute on the computer object, however cannot find a way to use that in a query, and can also not figure out the WQL to do the datediff calculation that would be needed. Perhaps there is some other property
within SCCM that can be used as well.
thanks and regards,
-Ravi

I was able to do this using the below:
added the whenCreated attribute to the "Active Directory System Discovery" discovery method. had to do this using the "custom" option.
This query finds the systems which have a whenCreated date less than 12 hours old -
select SMS_R_System.Name, SMS_R_System.whenCreated  from  SMS_R_System where DATEDIFF(hh,SMS_R_System.whenCreated,GetDate()) < 12
This link has information on the datediff functions and some other samples from which I was able to derive the above:
http://myitforum.com/cs2/blogs/gramsey/archive/2007/04/25/using-datediff-and-getdate-in-wql-for-sms-queries-and-collections.aspx

Similar Messages

  • Create a Collection of machines missing a single patch MS07-042

    Good Morning All,
       I am trying to create a collection for all machines missing a single patch.  MS07-042.  This patch has multiple KB numbers. 
    I noticed a couple of odd occurances.
    1) Console query builder does not expose the Updates classes.
    2) Console query builder does expose all the ITMU classes.  I am not sure if these are populated with the WSUS information gathered by the WUA.
    I did create the following query
    select * 
    from  SMS_R_System inner join SMS_UpdateComplianceStatus on SMS_UpdateComplianceStatus.MachineID = SMS_R_System.ResourceId
       inner join SMS_Softwareupdate on  SMS_Softwareupdate.CI_ID = SMS_UpdateComplianceStatus.CI_ID
    where SMS_Softwareupdate.BulletinID = "MS07-042"
    However, I am unable to locate any documentation on what the Status Fields indicate in SMS_UpdateComplianceStatus.
    My Questions
    1) Is there an easier way to do this?
    2) Is there any documentation on what the fields mean in SQL?
    I look forward to blogging about this as soon as I am sure of an answer.
    Best
    Shaun Cassells
    http://myitforum.com/cs2/blogs/scassells/default.aspx

    Torsten, do you have a refrence for the SMS_UpdateComplianceStatus table?  I want to know what the Status Field values represent.
    I realize this is an old thread, but I just wanted to put in my $0.02 in case someone else stumbles upon it looking for info.
    So, the SMS_UpdateComplianceStatus class (cuz we're talking collections here, which is WQL and pulls from WMI classes) is really the equivalent of the v_UpdateComplianceStatus view.  So if you want to see what's in that, go to SQL and query it.
    Also, if you want to know what the Status field values are, you can find those by looking at the v_StateNames view from SQL too where TopicType = 400 I believe.
    State 0 = Unknown
    State 1 = Not Required (meaning doesn't have patch and doesn't need it)
    State 2 = Not Detected (meaning it doesn't have patch but needs it)
    State 3 = Detected (meaning it has this patch)
    So, if you want to create a collection of machines that are missing a patch, you could do something like this:
    SELECT
      SMS_R_SYSTEM.ResourceID,
      SMS_R_SYSTEM.ResourceType,
      SMS_R_SYSTEM.Name,
      SMS_R_SYSTEM.SMSUniqueIdentifier,
      SMS_R_SYSTEM.ResourceDomainORWorkgroup,
      SMS_R_SYSTEM.Client
    FROM
      SMS_R_System
      JOIN SMS_UpdateComplianceStatus
        ON SMS_R_System.ResourceID = SMS_UpdateComplianceStatus.MachineID
        AND SMS_UpdateComplianceStatus.Status = 2
      JOIN SMS_SoftwareUpdate
        ON SMS_UpdateComplianceStatus.CI_ID = SMS_SoftwareUpdate.CI_ID
        AND SMS_SoftwareUpdate.ArticleID = 832671
    Number2 - (John Nelson)
    Microsoft MVP (2009) - System Center Configuration Manager
    http://number2blog.com

  • Error creating a new project in trial system

    I recently registered for a trial system to check Netweaver Gateway and build some sample services. Unfortunately could able to create a new project and being challenged with attached error"You are not authorised to create a new project "
    Does this mean the trial system/demo system only allows to consume the sample services but not create new services?

    Yes. demo system only allows to consume sample services. see this discussion How to create new gateway services using SAP Gateway demo system
    Regards,
    Chandra

  • Couldn't create jco client connection for logical system

    Dear Experts,
    we are facing a strange issue in our custom webdynpro java application, few of our portal users are getting the "couldn't create jco client connection for logical system" for Model Data JCO Destination. below are details
    1. portal version 7.02 SP14 (we have recently updated to SP14 from SP02-- is this is causing the issue ?)
         1.1. updated the NWDI track with SP14 SCA files as well as added latest WD Runtime SCA file deployed the applications to Production also.
    2. above said exception is inconsistent and happening for only few users
    3. ping and test of jco destinations are successfull in content administration as well as in SLD, destinations were added in the SLD system.
    4. cleared the JCO ARFC meta data cache in webdynpro console
    5. jco destinations are configured using uid/pwd, configured user is not locked active and tested in the backend by logging in with the same user.
    6. restarted the portal server
    even though, we are getting the above said exception for few of portal users randomly.
    Please help me on this ASAP, as i am not getting any further help on this.
    Thanks,
    Ram.

    Hello Ram,
    Check the JCo Pool Configuration settings of your JCO Destination. This message normally comes when the maximum connections has been reached. Increase the "Maximum Connections" to some number depending on the usage. A good habit is to disconnect the jco connection after executing the same in your webdynpro code if you don't want it to be synchronous.
    <ModelName>.modelInstance().disconnectIfAlive()
    Hope this helps.
    Regards
    Vijay

  • Getting errors when creating a collections

    Need help.  Every time I try to create a collection i get the following error:
      Error: The SMS Provider reported an error.
     General
    • Collection Name: Testing123
    • Comment:
     Membership Rules
    • (Query) Testing
    This looks like a generic error message.  I'm not sure where to look to find the error logs.  I do not see anything in application and system event logs that will help me.  
    Thanks!

    Check the SMSProv.log for more details about this error.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Create Device Collection WITH Refresh Schedule using Powershel CMDLets

    Hello everyone
    I'm attempting to create a PowerShell script to create a device collection and I'm running into a very frustrating issue.  I want to be able to set the collections refresh time but can't seem to get it to work.  This code here works to create the
    collection and tell it to do incremental updates but I cannot figure out how to set refresh time.  Everything I've attempted has failed and google seems to be no help right now.
    $CollectionName = "Test"
    $CollectionQueryValue = 'select * from SMS_R_System inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SYSTEM.NetBIOSName in ("Hostname")' $CollectionQueryName = "Direct by Hostname"
    New-CMDeviceCollection -Name $CollectionName -LimitingCollectionName "All Systems" -RefreshType ConstantUpdate
    Thanks for your help!

    I haven't tried it, but the following should work:
    $Sched = New-CMSchedule -Start "01/02/2014 1:00 AM"
    -DayOfWeek Sunday -RecurCount 1
    New-CMDeviceCollection -Name "C1"
    -LimitingCollectionName "All Systems" -RefreshSchedule $Sched -RefreshType Both
    Torsten Meringer | http://www.mssccmfaq.de

  • Error creating site collection - Could not load file or assembly 'Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0

    Hi,
    When creating a Site collection using Central admin, i am getting the error "One or more types failed to load. Please refer to the upgrade log for more details." . Microsoft.ApplicationServer.Caching.Core dll version on my machine is 1.0.4632 (App
    Fabric 1.1). 
    Stack Trace
    SharePoint Foundation Upgrade SPSiteWssSequence ajywy ERROR Exception: Could not load file or assembly 'Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot
    find the file specified. dd64ad9c-0f90-e07d-aaaa-13533e0e9e4f
    Thanks,
    Thomas

    Hi Thomas,
    According to your description, my understanding is that you got an error when you created a site collection in SharePoint 2013.
    I found a similar thread with yours, maybe it also was created by you. Anyway ,in the thread, the workaround is Changing the virtual directory web config of CA (Option 1 and 2 mentioned at
    http://technet.microsoft.com/en-us/library/dn473937.aspx ) and it worked.
    More information, please take a look at:
    http://sharepoint.stackexchange.com/questions/111439/error-creating-site-collection-could-not-load-file-or-assembly-microsoft-appl
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Creating smart collections using Import Smart Collection settings

    Does anybody know if I can create smart collections using Import Smart collection settings? Where can I find any information on this other than Photo collections? In particular, I am interested in what to do with the ID.

    I'll try to explain the best I can. I am trying to improve my workflow.
    I have been a little lazy with my workflow, I don't rate by images for 2 reasons: 1) I haven't found a rating system I am comfortable with (we might have discussed this on another thread), and 2) I am not very good at critically assessing my own photo graphic work. This means I have very often jumped to the develop module to adjust an image without ever bother to rate them (almost 20% of my catalog).
    I have also rated some images and never touched them.
    So I have a need to find images I have rated and adjusted, images I have rated and not adjusted, and images I have adjusted and not rated.
    Now, my photographers vision and knowledge have both changed substantially over the past 5 years. So to make the task more manageable I am trying to divide my catalog into 3 collections per year:
    1 - Rated and adjusted
    2 - Rated and not adjusted
    3 - Adjusted and not rated
    The assumption is that this is the bit of the catalog worth looking at and re-organise first. I know that anything I edited last year would have been more proficiently edited that anything I edited in 2010.
    Does it make some sense?

  • Is there a way to create a collection based on the "previous import"?

    is there a way to create a collection based on the "previous import"? that would make it easy to mobile sync the last import to my ipad, and do further picking/rejecting while away from my laptop.

    well, yes, of course i could do it that way. i guess i wasn't specific enough. is there a way to create a smart collection, with the photos in the "previous import" as members of the smart collection.  earlier i mentioned about using this smart collection to mobile sync with my ipad, to do further flagging.
    so my intention, use a smart collection to mobile sync with my ipad, and the smart collection to include the photos from my previous import.
    i guess another way to ask the question, is there a way to create a smart collection, by using some rule or condition in the smart collection, to automatically include previous import photos.
    the documentation says that "previous import" is a collection, even though it shows up in the catalogue side bar section. but i see no way to choose that collection when making a smart collection.
    jd

  • How do I create multiple live USBs of Operating systems to boot from on one flashdrive?

    How do I create multiple live USBs of Operating systems to boot from on one flashdrive?
    I am attempting to create multiple live USBs within one flashdrive so that i can boot various operating systems without having to buy multiple USb sticks. I am using a Mac OS X Snow Leopard 10.6.8 Operating System currently. I am using the Terminal provided by the OS.
    I would like to try Debian, Kali, Precise Puppy, and Sabayon- with one space left empty for whatever Linux OS I would like to try next. I have partitioned an 8GB flashdrive into the following sections:
    name of intended OS,     space allocated for it:
    1)Debian ........................1.32 GB
    2)Kali..............................2.61GB
    3)Precise Puppy..............163.7MB
    4)Sabayon.......................1.77GB
    5)TBD..............................2.14GB
    I have figured out how to change the .iso files of the operating systems into .img files with the following commands:
    hdiutil convert -format UDRW /path/to/input.iso -o /path/to/output.img
    a .img.dmg file is created, this is corrected in the next line of code *please note: I am a a very beginner at programming, and would greatly appreciate any help. Thank you!
    mv /path/to/output/file.img{.dmg,}
    This is where I started to get confused:
    I entered diskutil list to find the location of the partitions on my flashdrive, and this is the relevant section:
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *8.0 GB     disk1
       1:                 DOS_FAT_32 DEBIAN               1.3 GB     disk1s1
       2:                 DOS_FAT_32 KALI                    2.6 GB     disk1s2
       3:                 DOS_FAT_32 PRECISE            163.7 MB   disk1s3
       4:                 DOS_FAT_32 SABAYON           1.8 GB     disk1s5
       5:                 DOS_FAT_32 TBD                     2.1 GB     disk1s6
    This is the code I attempted to use and the subsequent result:
    charles-burtons-mac-mini:~ charlesburton$ sudo dd if=/Users/charlesburton/Desktop/debian-live-7.2-i386-gnome-desktop.img of=/dev/disk1s1 bs=1m
    dd: /dev/disk1s1: Resource busy
    *at this point I went to the Disk Utility GUi and unmounted only the DEBIAN partition, now back to the terminal*
    charles-burtons-mac-mini:~ charlesburton$ sudo dd if=/Users/charlesburton/Desktop/debian-live-7.2-i386-gnome-desktop.img of=/dev/disk1s1 bs=1m
    dd: /dev/disk1s1: end of device
    1259+0 records in
    1258+1 records out
    1320005632 bytes transferred in 1011.966891 secs (1304396 bytes/sec)
    Please may someone help explain why I had a return value of +1 in my records in and how I can make it work properly.

    I would like to know the answer to this as well.  I tried renaming the 3D version by adding 3D after it, but it still not a separate movie in iTunes.
    It's putting them in the same folder.

  • Creating a collection from a query in Apex 4.2 is not populating the data into the collection.

    I have a process that creates a collection with data from multiple tables. The query returns multiple rows in 'Sql commands' tab. The same query is used to create the collection in 'Before Header' and when i create a region with Region source as
    Select * From apex_collections Where collection_name = 'load_dashboard';
    At the time of rendering the page shows me 'no data found'.
    what could be the problem? Are there any prerequisites before creating the collection?
    Thanks in Advance,
    Sriram

    Hi Denes,
    Below is my code for creating and saving data into the collection.
    if apex_collection.collection_exists(p_collection_name =>'load_dashboard') then
       apex_collection.delete_collection(
             p_collection_name =>'load_dashboard');
    end if;
    apex_collection.create_collection_from_query(
        p_collection_name => 'load_dashboard',
        p_query => 'select a.rowid
                   ,b.first_name
                   ,b.last_name
                   ,c.job_title
                   ,d.parent
                   ,d.child_level_1
                   ,d.child_level_2
                   ,a.resource_allocation
                   ,a.person_id
                   ,a.month_id
                   ,a.oracom_project_id    ,wwv_flow_item.md5(a.rowid,b.first_name,b.last_name,c.job_title,d.parent,d.child_level_1,d.child_level_2,a.resource_allocation,a.person_id,a.month_id,a.oracom_project_id)
    from oracom_resource_management a, oracom_people b,oracom_job c ,oracom_project d where a.supervisor_id=886302415 and a.month_id=201312 and a.oracom_job_id=c.job_id and a.person_id=b.person_id and a.oracom_project_id=d.oracom_project_id',
       p_generate_md5 => 'YES'
    Sriram.

  • Create DB link between my local system and remote system

    Hi,
    I need help to create DB link between my local system Database and remote system database both the database are oracle.
    Please check the script which i have written is correct or not. Its giving me error sql command not ended properly
    create public database link MERU_PROD_LOCAL_PROD
    CONNECT TO SUDHIR
    identified by sudhir123
    using (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = tcp.world)
    (PROTOCOL = TCP)
    (Host = 23.23.150.144)
    (Port = 1521)
    (CONNECT_DATA = (SERVICE_NAME = sudhir)
    I am executing this command in my local system connecting to the remote database link. Please suggest me is this method correct.
    Thanks
    Sudhir

    Hi Hilton,
    I fixed that issue. Now i am creating the DB link this ways please check is this proper or not
    create or replace database link meru_prod_local_prod connect to portal identified by Oracle!123 using 'MERUPROD';
    remote machine
    User Name: portal
    Password : Oracle!123
    MERUPROD is the tnsora entry
    It gives error as
    Error starting at line 1 in command:
    create or replace database link meru_prod_local_prod connect to portal identified by Oracle!123 using 'MERUPROD'
    Error at Command Line:1 Column:18
    Error report:
    SQL Error: ORA-00922: missing or invalid option
    00922. 00000 - "missing or invalid option"
    *Cause:   
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Create trasport reqeusts directly in quality system

    Hello All,
    We have a three system landscape TMS configuration (DEVL-QUAL-PROD) and QUAL is defined as consolidated system.
    Because of lot of developers doing/testing changes to configuration on DEVL, we made some changes directly in QUAL intend to import into PROD system. Opened QUAL system just for this change.("Automatic recording of Changes" and "Changes to repository and cross-client customizing allowed" in QAUL) Note: It is not a good practice to open QUAL system but in this scenario we can't take risk of taking untested configuration from DEVL system.
    - When creating transport request, PROD is not showing up in the target system as QUAL is the consolidated system.
    - Created a transport request without target system thinking it would create local transport with CO and data file. After releasing the transport request system is not creating a CO and files. After doing research, looks like need to create a virtual system so that QUAL system would create co and data files. Once co and data files are created, I could add to PROD import queue manually.
    Could you please help... is creating virtual system is the only solution in this scenario. if i have to create a virtual system, all i have to do is STMS->SAP SYSTME->Create Virtual system. As PROD Is the domain controller, should i leave "PROD" as the communication system?
    Thanks a lot in advance

    Hi Sid,
    ==>Created a transport request without target system thinking it would create local transport with CO and data file. After releasing the transport request system is not creating a CO and files.
    Here,you have created a local transport since target system not mentioned.
    Local transport request will not create cofiles and datafiles.It means there is no target defined for that transport request. In such case, system assume that the changes made and captured in that TR are local (within the system) and need not to be moved in subsequent systems of transport landscape.
    So to create cofiles and datafiles for that particular request,we need to create transport of copies.
    Go to  SE10, create a new request of type "transport of copies":
    give it a description and specify the target system: in your case QUAL system
    Then, include objects from the old requests using the following button:
    (4th button, next to the trash can - "include objects")
    Finally, specify the old request "number" on the following prompt (where it says "request" on the following image):
    Then new request will get created  with the contents of old request.And it will create cofiles and datafiles at OS level .Then you can manually copy the cofiles and datafiles to system you need too import .
    Then Add into  queue from that system..
    Thanks,
    Needu

  • Problem when create a support massage from another system

    dear Support,
    we are work in our system with support massage to the service desk in the solution manager,
    we are create the massage from the source system and it open a massage in the service desk in the solution manager
    when we create a support massage it's send mail with the name of who open the massage, (For example : naors, benisa)
    my problem is that in 1 source system when i open the massage the mail send in a name of user basis (i think it's meen that the massage send the mail from user in the solution manager and no the user that open the massage)
    -i create a BP partner in solution manager and generate him in Tz BP_GEN
    but it's still send the mail from user "basis"
    besr regards
    Naor Shalom

    Hi
    Is the IBase filled in that particular ticket correct,please check?
    have you generated the ibase in IB_52 for this system too?
    Regards
    Prakhar

  • Escape '  ' while creating a collection in Oracle APEX

    Hi all
    I am creating a collection where I am using substr and instr functions and it does give an error message as below
    • ORA-06550: line 14, column 79: PLS-00103: Encountered the symbol ", -1)) OWSR, null PRIM_ADD , null PRIMA" when expecting one of the following: ) , * & = - + < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset
    Relevant Portion where the error pops up:
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
    p_collection_name => 'RANGE_COLLECTION',
    p_query => 'SELECT
              :P999_LOC_TYPE ADD_TYPE_ID
              , TRIM(:P999_OWSR) PRIM_ST
              , SUBSTR(TRIM(:P999_OWSR),1,1) PRIM_DIR
              , SUBSTR(TRIM(:P999_OWSR),INSTR(TRIM(:P999_OWSR), ' ', -1)) PRIM_SUF
    ......... on the line below
    SUBSTR(TRIM(:P999_OWSR),INSTR(TRIM(:P999_OWSR), ' ', -1)) PRIM_SUF
    Does anyone have any solution how to escape the single quotes in Oracle APEX 4.2. - like \' or something? I already tried using backslash but had no luck.
    Would really appreciate your help ASAP.
    Thanks,
    Rads

    Rads wrote:
    Does anyone have any solution how to escape the single quotes in Oracle APEX 4.2. - like \' or something? I already tried using backslash but had no luck.Quotes in string liberals in Oracle are escaped by doubling them up:
    execute immediate 'update emp set sal = sal * 1.2 where ename = ''SCOTT''';However a better approach when dealing with SQL strings is to use the alternative quoting mechanism:
    execute immediate q'{update emp set sal = sal * 1.2 where ename = 'SCOTT'}';as this allows the original string to be left unaltered.

Maybe you are looking for

  • Iphone 4S NOT recognized by iTunes 10.7

    My friend is using a 2007 Macbook running Snow Leopard. Her fairly new (3 mos) iPhone4S is NOT being recognized in iTunes 10.7, on her Macbook which is running OS 10.6.8. Her iphone4S hasn't been backed up yet, so she's running iOS 5 as her phone's o

  • None of the pictures will load on Tumblr. Not even the GIFs or Icons. What's wrong? How can I fix this?

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/813420'' Today, I was on Tumblr, when something popped up. It disappeared before I was able to read it. Suddenly, the page refreshed. Not one picture loaded. I am only able to rea

  • JScrollPane wont scroll .. pls help

    hi to all, I have a scrollpane that i am displaying a graph in, and they will be large graphs, 10000 nodes with about cardinality 10 for each node. I can generate the graph output no problems but my scrollbars dont allow me to scroll the pane, and i

  • RT31P2 + WRT54GL + Vonage problems

    Hey guys, I've been having a recurrent issue for a while now, and lately the problem has gotten a lot worse.  Before I describe the problem, I would like to explain the exact set-up that I have to better explain the situation. (I have had this set-up

  • In the search bar google search engine missing (and others)

    A number of search engines have gone missing. I guess I can add back the ones I've added in the past but Google is missing and I'm not sure how to add that back.