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

Similar Messages

  • SCCM 2012 - Creating a Collection with Limiting memebers to 5 or 10 Computers even the Memebership Query can pull 1000 members

    Dear Brothers,
    I am deploying a huge application (requires 45 Minutes to Install, 3 to 5 Restarts), and I need to limit the deployment to 5 computers at a time. Limiting my Network Load and also the availability of the computers in operation as it requires a successive
    Restart.
    My aim is to "Create" a "Collection" to focus on deploying the software to
    5 computers at a time. The collection that limits to 5 computers can help our production environment to focus on the total deployment time without disturbing other computers.
    Regards,

    I would use powershell to do this. Create a Collection with all the computers that should get the application.
    Then in powershell - get all the members of that Collection into a variable. Use that variable as a basis for creating new Collection and create some logic that takes 5-10 machines and put those into a new Collection and then takes the next 5-10 machines
    and so on.
    I guess you could also do it using a combination of Query and Exclude Collections membership rules, but you would have to do it manually.

  • Device Collections with Workgroup Computers

    Hi all,
    I'm having some trouble with creating device collections for workgroup computers.
    I made a collection for all workgroup computers which works great.
    I also made two collections dividing the workgroup computers; one with the x86 based computers and the other one with the x64-based computers. I'm having trouble with both collections as it doens't detect a single computer.
    If I make a collection for all domain x64 or x86 computers it works like a charm.
    Workgroup x64 Computers: (doens't work)
    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 inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID
    = SMS_R_System.ResourceId where SMS_R_System.ResourceDomainORWorkgroup = "WERKGROEP" and SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC"
    Workgroup x86 Computers: (doens't work)
    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 inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID
    = SMS_R_System.ResourceId where SMS_R_System.ResourceDomainORWorkgroup = "WERKGROEP" and SMS_G_System_COMPUTER_SYSTEM.SystemType = "x86-based PC"
    All Workgroup Computers: (works) 
    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 where SMS_R_System.ResourceDomainORWorkgroup = "WERKGROEP"
    Cheers

    I also tried to select x64-based and x86-based computers based on my All Workgroup Computers collection (limiting collection). But that also didn't work out:
    Workgroup x64 Computers on limiting collection All Workgroup Computers: (doesn't work)
    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 inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId
    = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC"

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • I created a website with iWeb but use GoDady for hosting it rather than MobileMe. The images on my Gallery page do not show at all on the external domain but they DO show when seen on MobileMe. Has anyone encountered this problem before? Many thanks!

    Hello al!
    I created a website with iWeb but use GoDady for hosting it rather than MobileMe. The images on my Gallery page do not show at all on the external domain but they DO show when seen on MobileMe. Has anyone encountered this problem before? Many thanks!

    Just create a new page (or use the existing photo page) on your external site and use html to add an iframe sized to the page and link it to the mobilme gallery page. Works for me just fine when showing my gallery from a yahoo site.
    like this
    <iframe scrolling="off" allowTransparency="true" frameborder="0" scrolling="yes" style="width:100%;height:100%;border:none" src="http://gallery.me.com/your_account_name"></iframe>

  • How can I  get System dates  with time scheduler using threads

    how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...

    What the heck are you talking about and whatr has it to do with threads?
    Current time: System.currentTimeMillis. Date instances are not supposed to be updated.

  • Unable to Create site collections with any template

    Hi All,
    We are using SharePoint 2013 , after long time am tried for create new BI center in one of our web application , but its taking more then 10 mints , the page is loading more then 10 mints , after that i just refresh the page and i got a error "Sorry
    this site was created already with this name".
    so , i try to enter the new site URL am getting error the page is not valid .
    i thought this was on issue with requirements on BI Center , so i checked the web application associated service application , but i have Visio Graphics service application , Excel Service Application and Performance point service application running for
    this web application .
    after some time i tried to create team site template site collection , i am facing the same issue again , i really dont know what is the issue with my CA , can any one help me to solve this issue ASAP.
    i tried to create site collection from PowerShell also , but am facing the same issue , even i got the same error while try to create sub site. i tried with refreshing IIS also , but its not worked.
    Am waiting for your valuable response .
    Thanks,
    Mani L
    Mani L

    Hello Mani L,
    Please make a host entry on you WFE server for the URL of the site you are trying to create. Then try browsing the site from same server.
    - First check if the binding is correctly configure in Alternate Access mapping on Central administration
    - Same binding should be provided under IIS for the web application
    If this doesn't resolve the issue then, for testing create a host entry for central admin hostheader url.
    To do this follow below mentioned steps:
    Go to Start -> Run -> Type drivers
    open HOSTS file in a notepad
    type IP address of the APP server and beside that with a tab key type URL of the site
    Save the file and try to browse the site in a fresh new browser after closing all the browser.
    Where SharePoint.com is my Host Header URL and IP address is the server IP where the site is hosted (APP Server generally)
    Thank You, Pallav S. Srivastav ----- If this helped you resolve your issue, please mark it Answered.

  • Can't create the mview with refresh on each commit

    I have these underlying tables:
    SQL> desc ta_footn_typ
    Namn Null? Typ
    FOOTN_TYP_ID NOT NULL VARCHAR2(2)
    APPL_COD CHAR(1)
    NATIONAL_DATA NUMBER(1)
    (FOOTN_TYP_ID is a PK)
    SQL> desc TA_S_DESC_FOOTN_TYP
    Namn Null? Typ
    FOOTN_TYP_ID NOT NULL VARCHAR2(2)
    LANG_COD NOT NULL CHAR(2)
    FOOTN_TYP_DESCR VARCHAR2(100)
    (FOOTN_TYP_ID and LANG_COD is a composite PK)
    from these two tables I would like to build a mateerialized view with refresh
    on commit with the following select-statement:
    select type.*, eng.FOOTN_TYP_DESCR as FOOTN_TYP_DESCR_ENG, nat.FOOTN_TYP_DESCR
    as FOOTN_TYP_DESCR_NAT from TA_FOOTN_TYP type
    left join TA_S_DESC_FOOTN_TYP eng on eng.FOOTN_TYP_ID = type.FOOTN_TYP_ID and
    eng.LANG_COD='EN'
    left join TA_S_DESC_FOOTN_TYP nat on nat.FOOTN_TYP_ID = type.FOOTN_TYP_ID and
    nat.LANG_COD='EE'
    I can create the mview with the options:
    on demand, automatically on, never
    but that is not interesting for me,
    I need refresh on commit on the underlying
    tables.
    So I tried -->
    CREATE MATERIALIZED VIEW "EMTS_NF"."MY_MVIEW"
    TABLESPACE "EMTS_EMTS_NF"
    BUILD IMMEDIATE
    USING INDEX
    TABLESPACE "EMTS_EMTS_NF"
    REFRESH FORCE
    ON COMMIT
    AS
    select type.*, eng.FOOTN_TYP_DESCR as FOOTN_TYP_DESCR_ENG, nat.FOOTN_TYP_DESCR
    as FOOTN_TYP_DESCR_NAT from TA_FOOTN_TYP type
    left join TA_S_DESC_FOOTN_TYP eng on eng.FOOTN_TYP_ID = type.FOOTN_TYP_ID and
    eng.LANG_COD='EN'
    left join TA_S_DESC_FOOTN_TYP nat on nat.FOOTN_TYP_ID = type.FOOTN_TYP_ID and
    nat.LANG_COD='EE';
    But it gives mee ORA-12054,
    any advices???

    Try it with REFRESH FAST instead of REFRESH FORCE.
    Cheers, APC

  • Create SharePoint 2010 Search Service Application Using Powershell

    Hi Team,
    Could you please assist me in completing the search service application for
    two server using powershell. Both the servers will be running all the component
    Version SharePoint 2010
    # 1.Setting up some initial variables.
    write-host 1.Setting up some initial variables.
    $SSAName = "Search Service Application"
    $SVCAcct = "Domain\ServiceAccount"
    $SearchAppPoolName ="DefaultAppPool"
    $SSI = get-spenterprisesearchserviceinstance -local
    $err = $null
    $SSADBName="Search_AdminDB"
    $SSADBServer="DBServer"
    $host1="Server1"
    $host2="Server2"
    # Start Services search services for SSI
    write-host Start Services search services for SSI
    Start-SPEnterpriseSearchServiceInstance -Identity $SSI
    # 2.Create an Application Pool.
    write-host 2.Create an Application Pool.
    #$AppPool = new-SPServiceApplicationPool -name $SSAName"-AppPool" -account $SVCAcct
    $AppPool = Get-SPServiceApplicationPool -Identity $SearchAppPoolName -ErrorAction SilentlyContinue
    # 3.Create the SearchApplication and set it to a variable
    write-host 3.Create the SearchApplication and set it to a variable
    $SearchApp = New-SPEnterpriseSearchServiceApplication -DatabaseServer $SSADBServer -Name $SSAName -applicationpool $AppPool -databasename $SSADBName
    #4 Create search service application proxy
    write-host 4 Create search service application proxy
    $SSAProxy = new-spenterprisesearchserviceapplicationproxy -name $SSAName"ApplicationProxy" -Uri $SearchApp.Uri.AbsoluteURI
    # 5.Provision Search Admin Component.
    write-host 5.Provision Search Admin Component.
    set-SPenterprisesearchadministrationcomponent -searchapplication $SearchApp -searchserviceinstance $SSI
    # 6.Create a new Crawl Topology.
    write-host 6.Create a new Crawl Topology.
    $CrawlTopo = $SearchApp | New-SPEnterpriseSearchCrawlTopology
    New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
    Source:blog.MSDN Author- Russ Maxwell
    Thanks Basva

    Could you please assist me in completing the search service application for
    two server using powershell. Both the servers will be running all the component 
    Hi Basva,
    Do you want to provision two search service applications in single farm?
    Commonly, only one search service application is needed in a farm for Search function.
    Here are articles for detail information about how to provision search service application using powershell:
    http://blogs.msdn.com/b/jjameson/archive/2011/02/28/powershell-script-to-configure-search-in-sharepoint-server-2010.aspx
    http://blogs.msdn.com/b/russmax/archive/2009/10/20/sharepoint-2010-configuring-search-service-application-using-powershell.aspx
    Regards,
    Rebecca Tu
    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]

  • Creating a MV with REFRESH ON COMMIT

    Hi,
    I can't seem to get the following Materialized View to compile:
    REATE MATERIALIZED VIEW MV_MyMatView
    REFRESH ON COMMIT
    AS
    SELECT COL_ValidFrom, COL_AnotherCol
    FROM MyTable
    I get error ORA-12054. Originally I had a MAX()-thing in my select and when I searched the web I found this article ( http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10736/basicmv.htm#i1007028 ) And it looked to be the solution. However I did everything it said and I still could not compile (same error). So I tried to remove the MAX() but i STILL could not compile. Any Ideas on what to do?
    The MV-Log was created like this:
    CREATE MATERIALIZED VIEW LOG ON MYSCHEMA.MyTable
    WITH PRIMARY KEY, ROWID
    INCLUDING NEW VALUES
    Could it be an issue that both my referenced columns are part of the Primary Key? I am the owner of the table. I also tried this: GRANT ON COMMIT REFRESH TO "MYSCHEMA"; but it was not recognized.
    Basically i cant create ANY materialized view with REFRESH ON COMMIT. Why, oh why?
    Thanks!
    Message was edited by:
    DavidNils

    Hello
    Unfortunately I don't have a 9i or 10g database to test on at the mo but I believe the package dbms_mview should help. There is a procedure called explain_mview that allows you to check what an mview can do. It dumps the results into a table so you can see what it can and can't do and why.
    Here's a link to the docs. http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_mview2.htm#95440
    Hopefully that will help you to find out why you can't do a fast refresh on commit.
    HTH
    David

  • I created a broacher with a template using pages but am unable to save it in JPEG. I tried saving as a pdf then using preview save as JPEG but it did not give that option??

    I have created a boucher with PAGES  using a template. How do I now get that teplate to JPEG?
    I tried convertong it to a PDF then saving , but I never got an option to save as JPEG.
    Appreciate any assistance.

    What version of Pages?
    Peter

  • Creating Sales Order with credit card using Process Order API

    Hi All,
    When trying to create sales order with payment type as Credit card using Order data storing into staging tables and then calling Order Import Concurrent Program. The order is being created in ENTERED state.
    While trying to passing the same details to Process Order API to create Sales Order, we are getting following error:
    Unable to set up a Credit Card Bank Account for the Customer.
    Credit Card information on the order is not valid.
    Why getting this error while using Process Order API.
    Regards,
    KANN.

    When using the API, are you trying to create the order as booked using the booked flag or the book action?  I would recommend using the action if you are not. To troubleshoot, I would try the API without booking and then use the following article to determine the issue:
    Unable To Setup A Credit Card Bank Account For The Customer. CC Information On The Order Is Not Valid (Doc ID 1450936.1)

  • Create Sales Order with type "return" using API

    Dears ,
    I tried to create a sales order with type Return using oe_order_pub.process_order but the order is not created .
    There is no error msg returned .
    Can anyone help me to solve this .?

    Hi 2800842
    Please use the following link for your issue;
    https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=539354996395765&parent=DOCUMENT&sourceId=746787.1&id=292…
    or visit metalink: How to create an RMA via Process Order API ? (Doc ID 292743.1)
    Thanks
    Mirza Tanzeel

  • Creating user accounts with OIDDAS and use them from the OS

    Hi,
    I have a customer that is experiencing an error creating user accounts from OIDDAS, and use that user accounts from the operating system.
    My customer is using OID/OAS4OS 10.1.4.2.0, and that version is not longer available to download, then, I will try in my own environment
    with OID/OAS4OS 10.1.4.3.0.
    And the question is the following: is supported to create user accounts with OIDDAS and expect that users can work with OAS4OS and be
    able to authenticate in the operating system?
    For the reference, SR# 7222351.993:
    Thanks,
    Luis Vivero.
    Edited by: LV in ORCL on Dec 11, 2008 6:47 AM

    Hi Jacco,
    I didn't see your post before.
    Nop, unfortulately I don't have a document with that. I just received that answer
    from development (related to the plugin for AD that is not certified, and DAS is
    not intended to work with OAS4OS).
    Anyway, about the plugin to work with AD, this is working for me; at least I tested
    it by configuring the plugin, I configured synchronization, the mapping file, I did
    the bootstrap, and the accounts that were bootstraped now shows the OS attributes
    on DAS.
    Regards,
    Luis Vivero.

  • Problem with IPAM Invoke-IpamGpoProvisioning PowerShell Cmdlet

    Hi Guys,
    I have an issue with IPAM configuration installed on a Windows Server 2012 R2 and I have DC, DNS and DHCP installed on Windows Server 2012 R2 on another server, when i run the PowerShell Cmdlet to provision the IPAM GPOs using the following Cmdlet (c:\Invoke-IpamGpoProvisioning
    -Domain mydomain.local GpoPrefixName KHA  -IpamServerFqdn IPAM.mydomain.local -DelegatedGpoUser administrator) i get this error. 
    Invoke-IpamGpoProvisioning : Failed to create universal group IPAMUG. Exception calling "CommitChanges" with "0"
    argument(s): "The server is unwilling to process the request.
    At line:1 char:1
    + Invoke-IpamGpoProvisioning -Domain mydomain.local -GpoPrefixName KHA -IpamServerFqdn ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Invoke-IpamGpoProvisioning], Exception
        + FullyQualifiedErrorId : InvalidOperation,Invoke-IpamGpoProvisioning
    How to solve this issue to find the GPOs created on the DC ?

    Hi ,
    Thank you for posting your issue in the forum.
    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
    Thank you for your understanding and support.
    Best Regards,
    Andy Qi
    Andy Qi
    TechNet Community Support

Maybe you are looking for

  • ORA-00942: table or view does not exist in database control

    Hi all, i am getting "ORA-00942: table or view does not exist" error while accessing tablespaces from database control. i am able to access control files, redo log files everything fine, but not tablespaces. database version ---> 10.2.0.1 OS ----> Re

  • How do I stop receiving messages on my macbook pro and receive them on my iPhone 5s?

    I have a macbook pro 13 inch with Retina display and intel core i5 and I also have an iPhone 5s. When I receive a new iMessage I only receive it on my macbook and not on my iPhone. I wanted to know how to go back to receiving messages on my iPhone an

  • FMW patching gets failing

    Hi friends, As a part of BIAPPS-ODI configuration, @ the step of Applying FMW patches biappshiphome patches is getting failed like in the final patching report im getting error like ----------START OF PATCHING REPORT------------------ * BIAPPSSHIPHOM

  • Matrix application for MDM 7.1

    Hi, Can you pls tell me where I can find the Marix aplication (EARs) in the s/w shipment of MDM 7.1? Thanks, Jyotika

  • Tab Glitch

    So even after updating to the latest version of Safari, I still have this glitch problem when opening a new tab in the browser. The problem happens more often then not and only when I go to open a new tab. Safari hangs for a few seconds and before th