Jump to content


Search the Community

Showing results for tags 'collection'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Cloud
    • Azure
    • Microsoft Intune
    • Office 365
    • Windows 365
  • General Stuff
    • General Chat
    • Events
    • Site News
    • Official Forum Supporters
    • Windows News
    • Suggestion box
    • Jobs
  • MDT, SMS, SCCM, Current Branch &Technical Preview
    • How do I ?
    • Microsoft Deployment Toolkit (MDT)
    • SMS 2003
    • Configuration Manager 2007
    • Configuration Manager 2012
    • System Center Configuration Manager (Current Branch)
    • Packaging
    • scripting
    • Endpoint Protection
  • Windows Client
    • how do I ?
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows Vista
    • Windows XP
    • windows screenshots
  • Windows Server
    • Windows Server General
    • Active Directory
    • Microsoft SQL Server
    • System Center Operations Manager
    • KMS
    • Windows Deployment Services
    • NAP
    • Failover Clustering
    • PKI
    • Hyper V
    • Exchange
    • IIS/apache/web server
    • System Center Data Protection Manager
    • System Center Service Manager
    • System Center App Controller
    • System Center Virtual Machine Manager
    • System Center Orchestrator
    • Lync
    • Application Virtualization
    • Sharepoint
    • WSUS

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests

  1. I am trying to build a collection based on the Last Online time (within an arbitrary number of days). I know typically this is done using the Heartbeat, ClientActivity, or Hardware scan property. but I would like to see all machines, to identify which machines may not have the client installed. I cant for the life of me find where the column in the collections view populates from. I have the queries to filter out machines based on Last Hardware Scan shown below. I am looking for something very similar, but as I said, i cant find the property for "Last Online Time"
  2. Hey Guys / Niall - I'm trying to script something which I've done parts of in the past, but not together at once and need some assistance, please... Overall, I'm trying to add hostnames as direct members to a different collection referenced on the same row of a CSV source. Below is an example of the CSV source which states the hostname in the first column and its domain in a 2nd column. A collection already exists per domain which is "Prod Servers: domainfqdn". For example, below is a similar CSV with headers: svr_name,svc_domainfqdn SYSTEM1,DOMAIN.5.com SYSTEM2,DOMAIN.6.com SYSTEM3,DOMAIN.4.org SYSTEM8,DOMAIN.6.local The desired result is that once the script executes, the following occurs: The hostname "SYSTEM1" is added via direct rule to the collection "Prod Servers: DOMAIN.5.com" The hostname "SYSTEM2" is added via direct rule to the collection "Prod Servers: DOMAIN.6.com" The hostname "SYSTEM3" is added via direct rule to the collection "Prod Servers: DOMAIN.4.org" The hostname "SYSTEM8" is added via direct rule to the collection "Prod Servers: DOMAIN.6.local" I've added systems to a single collection many times before using powerShell using something similar to the below, but am at a loss for how to add to multiple collections all within the same source. I've already created the collections for each domain, so no need to have the script check for them or do so. Any suggestions? Thanks!
  3. I'm using the following report and checking against all systems for %iTunes%. My report comes back with around 35 systems. However, I've created a collection for iTunes, and it is only showing 9 systems. The query I am using for the collection is the following. 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_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "iTunes" or SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName = "iTunes" Any suggestions? Thanks!
  4. __GENUS : 2 __CLASS : Win32Reg_AddRemovePrograms __SUPERCLASS : __DYNASTY : Win32Reg_AddRemovePrograms __RELPATH : Win32Reg_AddRemovePrograms.ProdID="{93F653D3-ED8B-4A04-BA58-3DF60B37D58B}" __PROPERTY_COUNT : 5 __DERIVATION : {} __SERVER : NAME_HIDDEN __NAMESPACE : root\cimv2 __PATH : \\NAME_HIDDEN\root\cimv2:Win32Reg_AddRemovePrograms.ProdID="{93F653D3-ED8B-4A04-BA58-3DF60B37D58B}" DisplayName : IBM Spectrum Protect Client InstallDate : 20170621 ProdID : {93F653D3-ED8B-4A04-BA58-3DF60B37D58B} Publisher : IBM Version : 08.01.0000 PSComputerName : NAME_HIDDEN OK. Here is my issue. I have created a collection that I am attempting to populate with all computers that contain the specific application listed above (IBM Spectrum Protect Client). I created the collection and a query using the criteria button, added the installed application, and chose the display name to match what is contained above. I do membership update, yet no computers appear in the collection. I can run a report (Companies & Products > Computers with specific software registered in Add Remove Programs) and match the same Display name, and return results. The reason I need the collection for the specific software, is I need to install an update that is only applicable to the specific version listed. Thanks
  5. Running 1610, I stumbled across something yesterday, and I'm wondering if anyone else has seen this: changing just the name of a query used to populate a collection breaks the collection. Steps to replicate: Change the name of the query being used as a membership rule for a collection. Collection's icon gets an hourglass, even though nothing about its membership actually changed. Hourglass doesn't go away, and collection membership no longer updates. The first time I saw this was with a query-based collection looking for %server% in operatingSystemNameAndVersion. Even after adding new devices to the environment and waiting overnight, those devices didn't get pulled into the collection this morning, even though delta was enabled so they should've been picked up within minutes. "Fixed" it by deleting and re-creating the collection. I have another, separate 1610 environment I work with regularly, so I jumped over to that one and created a new query-based collection to test with, looking for %string% in the system's name. Changed the name of the query, and sure enough, the collection's hourglass refused to go away (only left this one for 15 minutes, not overnight). Changing the actual query to %string2% seems to have gotten the collection working again, though obviously isn't really a fix, since string and string2 are different; just need to change back to the original string. Back to the initial environment, with a collection looking for system name ending with a number and a specific service existing and being set to auto-start: change the name of the query, and the hourglass has been stuck for 30 minutes. Changing the query in some non-meaningful way (adding a second space character after an "and") doesn't help. Changing the query in a meaningful way (look for a different service name) gets the collection working again. So it doesn't seem to matter what the query is looking for - three queries looking for three different things (though second and third are similar) and all of them break the collection if just the query name is change without changing the query itself.
  6. Recently setup Intune with SCCM integration. Now I would like to setup device collections based what division of the company that the device works for. Looking for some help on creating a query to sort the devices registered in Intune into device collections based on an ad group that the device owner is a member of. Example. User A is a member of AD Group - Company A. User's A's mobile device should be in collection A User B is a member of AD Group - Company B. User's B's mobile device should be in collection B
  7. Hello I currently have an extensive list of device collections in SCCM 2012, varying form using IP Ranges and Using Active Directory Site names. I see the totals of devices is populated which is great However in AD we have the default Containers 'Computers' where all computers end up when not part of any other group, i wish to create a device collection for this I initially tried to create a Site Based Collection titled 'No OU Devices' however i realised that the Computers Container is not an AD site, the current query is as follows 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.ADSiteName = "Computers" and SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Workstation %" Does anyone have any idea on how i can create a device collection on this Computers group Many Thanks Barrie
  8. I am an administrator of a large network that is slowly being merged into being managed by SCCM 2012. Currently Updates, SCEP, Application deployment, general troubleshooting, Compliance Rules, etc. are in use, and we're almost to the point of using OSD (several good tests with a few different images). Throughout the process, we've been assigning security to allow our Helpdesk to deploy images, and they already have the capability deploy software packages. They had been in charge of updates and SCEP patching, but they fell behind and now the Sys Admin team is handling all patching, to include SCEP. They currently do not have the ability to create/edit/deploy task sequences, OS images, drivers packs, compliance rules, they cannot edit or create collections, etc. All my previous experience has been that these items fell under an administrator role, not a helpdesk role. Management, and some political power grabbing has created a swing in SCCM security that may require that we provide the following to be administered by the helpdesk: Create/Edit/Delete/Deploy Collections (both user and Device) Create/Edit/Delete/Deploy Reports Create/Edit/Delete/Deploy Task Sequences Create/Edit/Delete/Deploy Compliance Rules Create/Edit/Delete/Deploy Software Applications Create/Edit/Delete/Deploy Software Updates Create/Edit/Delete/Deploy Desktop SCCM Policies Create/Edit/Delete/Deploy Antimalware Policies Create/Edit/Delete/Deploy Operating System Images and Bootable PXE Environments The only way I can think to do this with our current architecture, and stills plit off desktops and servers is to build a CAS server with two different Primary Site Servers (we are a One Primary Site server setup), and split the roles across servers using boundaries to ensure that servers are not being managed by the helpdesk group, and that desktops are not being managed by the server group. So my questions are these: Is this viable (is this nuts?) Is this secure Will this provide the level of accountability needed to allow two groups that are literally in different buildings to run their appropriate systems without crossover nuightmares Does this present a risk for system-wide disaster (Server wipe from errant Task Sequence/OSD) Are there other ways to do it if this is not suggested, and where can I find the docs (whitepapers, etc.) Does this follow Microsoft best practice for roles within SCCM Does anyone have any knowledge of articles where this was done and worked, or did not work. Any and all help is appreciated. Jay
  9. NOTE: Cross posted to Technet Forums I have used the Dell Client Integration Pack to import warranty data into SCCM. I imported their Warranty report which gives me information on all Dell systems in the database. How can I go about limiting this report to return data only from a specific collection? SELECT v_GS_COMPUTER_SYSTEM.Name0 AS Name, DellWarrantyInformation.Service_Tag AS [serial Number], DellWarrantyInformation.Build, DellWarrantyInformation.Region, DellWarrantyInformation.LOB AS [Line of Business], DellWarrantyInformation.System_Model AS [system Model], CONVERT(varchar, DellWarrantyInformation.Ship_Date, 101) AS [Dell Ship Date], DellWarrantyInformation.Service_Level_Code AS [service Level Code], DellWarrantyInformation.Service_Level_Description AS [service Level Description], DellWarrantyInformation.Provider, CONVERT(varchar, DellWarrantyInformation.Start_Date, 101) AS [Warranty Start Date], CONVERT(varchar, DellWarrantyInformation.End_Date, 101) AS [Warranty End Date], DellWarrantyInformation.Days_Left AS [Warranty Days Left], DellWarrantyInformation.Entitlement_Type, CONVERT(varchar, v_GS_WORKSTATION_STATUS.LastHWScan, 101) AS [Last Hardware Scan], v_GS_SYSTEM_CONSOLE_USAGE.TopConsoleUser0 FROM DellWarrantyInformation LEFT OUTER JOIN v_GS_SYSTEM_ENCLOSURE ON DellWarrantyInformation.Service_Tag = v_GS_SYSTEM_ENCLOSURE.SerialNumber0 LEFT OUTER JOIN v_GS_COMPUTER_SYSTEM ON v_GS_SYSTEM_ENCLOSURE.ResourceID = v_GS_COMPUTER_SYSTEM.ResourceID LEFT OUTER JOIN v_GS_WORKSTATION_STATUS ON v_GS_SYSTEM_ENCLOSURE.ResourceID = v_GS_WORKSTATION_STATUS.ResourceID LEFT OUTER JOIN v_GS_SYSTEM_CONSOLE_USAGE ON v_GS_SYSTEM_ENCLOSURE.ResourceID = v_GS_SYSTEM_CONSOLE_USAGE.ResourceID WHERE (DellWarrantyInformation.Entitlement_Type <> '')
  10. Hi, Does anyone know where to pull info like an error from Windows Update? I want to make a SCCM-collection based on computers that get a specific error in Windows Update. Appreciate the help guys
  11. Hi, all. SCCM 2012 SP1 with CU5. I'm seeing weirdness when setting up device collections that attempt to include systems based on both 32 bit and 64 bit applications being installed. I'm trying to combine "Installed Applications.Display Name" (SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName) with "Installed Applications (64).Display Name" (SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName), but the result isn't what I'm expecting - the collection actually shrinks, instead of growing, which I would think is impossible, since it's an OR. Example using Java: Criteria "Installed Applications.Display Name" like '%java 8' I get 34 members in the collection If I then change the criteria to "Installed Applications.Display Name" like '%java 8%' OR "Installed Applications(64).Display Name" like '%java 8%' Update membership, and the collection drops to 26 members. Some of the dropped ones are systems that I know for a fact have 32-bit Java 8 installed. All of the dropped systems are running a 32 bit version of Windows. I would expect that this would get *any* systems, regardless of OS architecture, with 32-bit Java 8 (since these match the statement before the OR) plus any systems with 64-bit Java 8 (since they match the statement after the OR). What appears to actually be happening is that once the statement to check the 64 bit app list is added, all systems that are running a 32 bit OS are removed from the collection, even though they do match the first criterion. Is this intended behavior? Do I need to massage the query statement? To this point, I've just been using the auto-generated query statement that setting up via the GUI comes back with. Or is this just not possible, and I'd need to create two (32 bit via query, 64 via query + include other collection) or three (32, 64, both via inclusion) separate collections?
  12. I am looking for a query that finds all computers joined to the domain since XX date. I tried using the query below which looks back over the last week for new computers but this also discovers any computers that have been modified in the last 7 days. Does anyone have a query that is based on date created? select SMS_R_System.Name, SMS_R_System.CreationDate FROM SMS_R_System WHERE DateDiff(dd,SMS_R_System.CreationDate, GetDate ()) <= 7
  13. I am working on helpdesk remediation strategies for virus notifications. I have setup alerts and find that most viruses get cleaned so the machine does not show up in the at risk collection. I want to setup a collection where a machine is infected so my helpdesk can deploy a cleaning package if the machine cannot be replaced right away. I have setup a device collection with the following criteria however I wanted to make sure this is correct. Usint he GUI it is set to Criteria Antimalware Infection Status.ComputerStatus is equal to 2 sql view looks 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 inner join SMS_G_System_AntimalwareInfectionStatus on SMS_G_System_AntimalwareInfectionStatus.ResourceId = SMS_R_System.ResourceId where SMS_G_System_AntimalwareInfectionStatus.ComputerStatus = 2 Jus want to confirm if this looks correct. Running the query shows 1 machine I know to be cleaned but recently infected, however it does not list a second machine listed in the infected computers report, however the report is looking at a week long data.
  14. Trying to make a collection of "all systems that have checked in with AD in the last 90 days" and I am not having much luck. I think I need to query on the pwdLastSet AD attribute but I can not figure out how best to do it. Thank
  15. ====================================================================================================================================================================================== >> Available via download here on the TechNet Galleries! << ====================================================================================================================================================================================== I do have to admit that this tool is already available in it's final form for over a month, but it seemed appropriate to also post here about this final relase. I think this right-click action might be very usefull for most administrators. It also took quite a while before I finally made a 1.0 version of this script/ form. Now it’s there, I also have to admit that I’m even a bit proud of it! It was a nice way of getting familiar with PowerShell and WMI. With answering a few very basic questions, I'll try to provide as much information as possible. What functionalities does it provide?This right-click action shows a lot of detailed information about the collections of which a device is a member and also about the collections that the primary user of a device is a member. A quick overview of all the functionalities comes down to the following information per tab: Tab – General; The Name, Id. Limiting Collection, Last Update and Last Membership Change of the Collections. Tab – Deployments; The Name of the Collections and the Name, Type aand State of the targeted Deployments. Tab – Variables; The Name of the Collections and the Name, Value and Type of the Collection Variable. Tab – Maintenance Windows; The Name of the Collections and the Name, Start Time, Duration, Recurrence, Schedule, Type of the Maintenance Window. Tab – Power Management; The Name of the Collections, the Name of the Non-Peak Power Plan and the Name, Start Time, End Time and Wake-up Time of the devices in the Collection. Tab – Primary User: Tab – General; The Name of the Collections, Id, Limiting Collection, Last Update and the Last Membership Change of the Collections. Tab – Primary User: Tab – Deployments; The Name of the Collections and the Name, Type and State of the targeted Deployments. What does it look like?To show the power and usage of this right-click action, I created the following small movie: Where is it available?The final version of my Collection Details Form is publicly available via the TechNet Galleries and for a direct download, via ShowCollectionDetails_v1_0p.ps1. How can it be used?To use this script as a right-click action, save the script at [sCRIPTLOCATION], make sure that the folder <AdminConsoleInstallDir>\XmlStorage\Extensions\Actions\ed9dee86-eadd-4ac8-82a1-7234a4646e62 and the folder <AdminConsoleInstallDir>\XmlStorage\Extensions\Actions\3fd01cd1-9e01461e-92cd-94866b8d1f39 exist and add a XML file to those folders as specified here: <ActionDescription Class="Group" DisplayName="Custom Actions" MnemonicDisplayName="Custom Actions" Description="Custom Actions" SqmDataPoint="53"> <ShowOn> <string>ContextMenu</string> </ShowOn> <ActionGroups> <ActionDescription Class="Executable" DisplayName="Show Collection Details" MnemonicDisplayName="Show Collection Details" Description="Show Collection Details"> <ShowOn> <string>ContextMenu</string> </ShowOn> <Executable> <FilePath>PowerShell.exe</FilePath> <Parameters>-ExecutionPolicy ByPass -WindowStyle Hidden "[sCRIPTLOCATION]\ShowCollectionDetails_v1_0p.ps1" -ResourceId "##SUB:ResourceId##" -SiteCode "##SUB:SiteCode##" -SiteServer "##SUB:__Server##</Parameters> </Executable> </ActionDescription> </ActionGroups> </ActionDescription> Questions?Please don't hesitate to drop any questions, either here or via my own blog at: www.petervanderwoude.nl
  16. Is it possible to set up multiple maintenance windows on one collection or is the solution to set up multiple collections and set up maintenance windows for each collection?
  17. I have been deploying software packages to different collections and can see what percentage of the collection successfully installed the package, but is there a way in SCCM 2012 to see what pc's did NOT install the software package? Is this a report manager task? *Edit* I asked and answered my own question. I was able to find the report to show the status of the deployment down to which pc received it and which did not.
  18. I'm pretty new to building queries and am currently trying to familiarize myself with SQL and the SQL Views to further help run queries. I've been having a hard time trying to build a collection of computers that have one of our inventoried software items on it. Within Inventoried Software, I have several products with different names all containing the word Coupon. Coupon toolbars, programs, etc. These are all security threats, and I have positive software counts for each. I'd like to create a collection (or run a report) of all machines with this software installed so I can remove the software. I've tried different variations of criteria in my query statement without success. Installed software, installed application, etc. each with the product name or publisher name return no results. I'll paste my most recent attempt below: 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_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName like "Coupon" Any help would be appreciated!
  19. I need a report showing a list of SCCM Collection and the number of computers in each Collection within our environment. Does anyone have a report or query like that I can use? I can't find a standard report like that in SCCM 2012 SP1.
  20. Afternoon Everyone, I am trying to create a report in CM 2012 R2 which will report the OUs which machines are a member of. I want to limit this so that I can select a specific collection and it will report that. I have found various things online and followed quite a few, but I am in no way a SQL master Would it be possible for someone to have a gander at the attached and see what I am going wrong with - I think it is something to do with altering the Getting_the_ous query to encompass the collectionID. When I run it at the moment I can pick a collection and I can then click view report, this runs but doesnt limit it to a collection and hows the everything! Thanks John Getting the OUs SELECT DISTINCT dbo.v_GS_COMPUTER_SYSTEM.Name0, dbo.v_R_System.User_Name0, MAX(dbo.v_RA_System_SystemOUName.System_OU_Name0) AS Expr1, dbo.v_GS_COMPUTER_SYSTEM.Description0, dbo.v_GS_COMPUTER_SYSTEM.Manufacturer0, dbo.v_GS_COMPUTER_SYSTEM.Model0, dbo.v_GS_PC_BIOS.SerialNumber0 FROM dbo.v_GS_COMPUTER_SYSTEM INNER JOIN dbo.v_R_System ON dbo.v_GS_COMPUTER_SYSTEM.ResourceID = dbo.v_R_System.ResourceID INNER JOIN dbo.v_RA_System_SystemOUName ON dbo.v_GS_COMPUTER_SYSTEM.ResourceID = dbo.v_RA_System_SystemOUName.ResourceID INNER JOIN dbo.v_GS_PC_BIOS ON dbo.v_GS_COMPUTER_SYSTEM.ResourceID = dbo.v_GS_PC_BIOS.ResourceID GROUP BY dbo.v_GS_COMPUTER_SYSTEM.Name0, dbo.v_R_System.User_Name0, dbo.v_GS_COMPUTER_SYSTEM.Description0, dbo.v_GS_COMPUTER_SYSTEM.Manufacturer0, dbo.v_GS_COMPUTER_SYSTEM.Model0, dbo.v_GS_PC_BIOS.SerialNumber0 Getting the collection list Select * from V_collection
  21. Is it possible to set up auto deployment of the SCCM client to a single collection. Here is my scenario... I have SCCM 2012. We build enough servers on a pretty regular basis so that I've created an OU (and a collection that targets said OU) that they can drop the servers into, and they will get SCEP, Updates, standard software, etc. The only issue is, I have to do a SCCM client push before it will install any of that stuff. Is there a way I can target this Collection (OU) for automatic SCCM client installation without having to use GP (The folks in charge of group policy are different than my group, so I want to keep as much of the process internal as possible). Thanks in advance, Jay
  22. I created a task sequence to uninstall Adobe Reader from a collection of computers and then install a modified version of Reader with a specific path. It's working but...I'm wondering how I go about getting SCCM to reinstall the modified version if a user updates Reader and breaks the specified path I have set? These computers are part of a collection so if a user updates Reader will SCCM run the deployment again or would I have to manually run the deployment again? Make sense?
  23. Hi everyone, I have got a question on how to cancel a software distribution to a collection. Let me specify. We have 2 collections, servers and workstations. On the root of the workstation collection there are several software packages advertised to run on the collection and on all sub-collections. As soon as you add machines to the workstation collection or any sub-collection, the packages get advertised. Now someone wrongly created a sub-collection in workstations with servers in it. All the packages advertised to the workstations collection have been pushed to the servers. Luckly we us maintenance windows on the servers and the error was noticed and the servers were removed from the collection. But when I run the report "Status of a specific advertisement" I can see that the servers are still in the waiting status. More specific, waiting for service window. And, this service window is next weekend. My question now is will the software still be installed on the servers even as they are removed from the wrong collection? Can I cancel the advertisement on the servers? It only show in the reporting that there are advertisements pending. I can't find anything about the advertisements using the sccm client center app. Thank you in advanced. Grtz, Geert
  24. Hello at all, I’m working on a script which creates a SCCM collection and appends a collection rule. The function createCollection creates and moves the collection without any problems. The collection rule object is also created without any error codes, but at adding the collection rule (newCollection.AddMembershipRule newCollectionRule) I get a “general error”. Has anybody an idea how to fix this problem? Function createCollection(collectionName)     Dim validQuery, queryExpr ' creates the collection.     Set newCollection = objSccm.Get("SMS_Collection").SpawnInstance_()     newCollection.Name = collectionName     newCollection.OwnedByThisSite = True     newCollection.Comment = "Comment"               Set collectionPath = newCollection.Put_ ' Attempts to obtain the collection ID of the newly created collection. Set Collection = objSccm.ExecQuery ("select * from SMS_Collection where Name='" & collectionName & "'") For each objCollection in Collection     strCollectionID=objCollection.CollectionID Next If strCollectionID = "" Then     Wscript.Echo "Unable to obtian a collection ID for the newly created collection."     WScript.Quit Else     ' Attempts to move the newly created collection into the desired parent collection.     Set newCollectionRelation = objSccm.Get("SMS_CollectToSubCollect").SpawnInstance_()     newCollectionRelation.parentCollectionID = strParentCollectionID     newCollectionRelation.subCollectionID = strCollectionID     newCollectionRelation.Put_ End If      'Attempts to create and add the query rule group to the collection!     Set stdQuery = objSccm.Get("SMS_CollectionRuleQuery")     validQuery = stdQuery.ValidateQuery(queryExpr)          If validQuery Then          Set newCollectionRule = stdQuery.SpawnInstance_     newCollectionRule.QueryExpression = queryExpr     newCollectionRule.RuleName = "Rulename"          Set newCollection = objSccm.Get(collectionPath.RelPath)     newCollection.AddMembershipRule newCollectionRule     newCollection.RequestRefresh False       End If End Function
  25. ============================================================================================================================== To reach an even wider audience. This is a new tool, which I released this monday. >> Available via download here on the TechNet Galleries! << ============================================================================================================================== The script creates a form to show the Collection Details for a specific device. Normally, from within the console, it is hard to see what collection settings are all affecting the device. By running this script it will directly show the collection memberships of the device including the applicable deployments, maintenance windows, power settings and collections variables.It uses the ResourceId as input, so it can easily be used as a right-click action (see my own blog for an example). To use this script the following input variables are required: ResourceId - Specify the ResourceId of the device. SiteCode - Specify the site code of the ConfigMgr site. SiteServer - Specifify the site server name. Example: PowerShell.exe -ExecutionPolicy ByPass .\ShowCollectionDetails_v0_9p.ps1 -ResourceId 16777224 -SiteCode PTP -SiteServer PTSRVR02 Version 0.9 shows the following details: (New!) Tab – General; The Name of the Collections. (New!) Tab – General; The Id of the Collections. (New!) Tab – General; The Limiting Collection of the Collections. (New!) Tab – General; The Last Update of the Collections. (New!) Tab – General; The Last Membership Change of the Collections. Tab – Deployments; The Name of the Collections. Tab – Deployments; The Name of the targeted Deployments. Tab – Deployments; The Type of the targeted Deployments. Tab – Deployments; The State of the targeted Deployments. Tab – Variables; The Name of the Collections. Tab – Variables; The Name of the Collection Variable. Tab – Variables; The Value of the Collection Variable. (Updated!) Tab – Variables; The Type of the Collection Variable. Tab – Maintenance Windows; The Name of the Collections. Tab – Maintenance Windows; The Name of the Maintenance Window. Tab – Maintenance Windows; The Start Time of the Maintenance Window. Tab – Maintenance Windows; The Duration of the Maintenance Window. Tab – Maintenance Windows; The Recurrence of the Maintenance Window. Tab – Maintenance Windows; The Schedule of the Maintenance Window. Tab – Maintenance Windows; The Type of the Maintenance Window. Tab – Maintenance Windows; Whether the Maintenance Window is enabled or not. Tab – Power Management; The Name of the Collections. Tab – Power Management; The Name of the Non-Peak Power Plan. Tab – Power Management; The Name of the Peak Power Plan. Tab – Power Management; The Start Time of the Peak Power Plan. Tab – Power Management; The End Time of the Peak Power Plan. Tab – Power Management; The Wake-up Time of the devices in the Collection. Please let me know what you like and don't like about this script/ tool at: www.petervanderwoude.nl
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.