Sccm user device affinity sql query Boundary groups is a column option. Name0 != 'Null' order by vrs. Using the User fields on the System object itself is not a reliable way to associate user with device. full name login Hostname make/model date Microsoft SQL Server Administration and T-SQL Programming including sql tutorials, training, MS SQL Server Certification, SQL Server Database Resources. microsoft. So to identify the last device which a user uses I have one. However, you can use this method to get an idea about the conversion process and get an idea about the SQL The Get-CMUserDeviceAffinity cmdlet gets one or more user device affinities in Configuration Manager. resourceID', and I removed the SystemConsoleUser0 from the Group by clause to get only the latest user-logon registration. The User and Device Affinity settings for users allow you to specify whether you want to enable a user to define their primary device. Remote Manage. I'm a newb, so I didn't know or think to run any sort of query there. Can anyone point me in right direction in creating a query for a device collection from a list of user names? Looking for last logged on user. Example: Hardware 01A - Summary of computers in a specific collection Dec 12, 2018 · 1. When you double click a device in the console, see the information there ? dbo. Last_Logon_Timestamp0 [Last logged in time] FROM dbo. After Configuration Manager creates an automatic user device affinity, it In Configuration Manager, user device affinity defines a relationship between a user and a device. Some users will have received an association with servers as well as workstations. Full_User_Name0[Full Name] From v_R_System SD Join v_FullCollectionMembership FCM on SD. Out asset-system that queries the SCCM DB gives me both my machines when i filter by topuser. We are getting the results but they do seem to be accurate. Reload to refresh your session. Find the User under "Users" Right click the username and click on "Edit Primary Devices" A list will display, like this - Now I want to know what view or table holds this information so I can query what was defined by the user (Catalog Defined), Administrator or ConfigMgr through User Policy. Risk Calculator. Lists information, by resource ID about user logons to devices. Broken clients, device certs not renewed, etc. ResourceID left join v_R_System vrs on upm. First of all we need a create a query on sccm console, ıf you have already created, you can also use same wql query to get its sql query on logs. Open the SQL Management Studio from the SQL box. I don’t think the SQL query that you get from the conversion process is not similar to the standard SQL queries. Full_User_Name0, U. LastHWScan I use instance called SMS_UserMachineRelationship to get the User machine relationship. A Specific System Is Part of what are all Collections Declare @Name Varchar(255) Set @Name = 'CLIENT01' --Provide Computer Name Select vrs. UniqueUserName left join v_GS_COMPUTER_SYSTEM on v_UserMachineRelationship. Aug 21, 2019 · This blog post will detail the various way to identify your user and primary machines and we also provide a free SCCM primary device report that you could use to easily find an association. I test with my own user, as i know i have at least two devices with me as top console user. May 13, 2016 · Here is the SQL query I used to create this report. ResourceID = FCM. However, querying the views directly can be much faster than using WMI and WQL, which receive a query request and in turn query the SQL Server database I made a SQL query: Select SD. Name0,fcm. You switched accounts on another tab or window. Nov 2, 2012 · let me preface this post by saying, this is in a 2007 environment. You should then be able to join that user with the AD User Discovery tables with the email address attribute. Manufacturer0 from v_R_User left join v_UserMachineRelationship on v_R_User. name as 'CollectionName',vrs. ResourceID Not sure you can as you can't use most SQL functions. Using SQL to directly modify the ConfigMgr DB is completely unsupported and may/will cause issues Here is something close. SQL Server Collections This query creates a Jun 21, 2021 · In the results, see the column name. Unique_User_Name0 FROM v_R_System About User Device Affinity. v_GS_SYSTEM_ENCLOSURE. How to write an SQL Query for SCCM, displaying the Machine Id, User Log Ins, Log Outs, and their Duration on the Machine (Historically)? I'm trying to write a query to get data about historical user activity. A SQL query isn’t needed for this. Order by . ResourceID WHERE vru. As an SCCM administrator, understanding how to query the underlying SQL database can significantly enhance your ability to extract insights, automate tasks, and troubleshoot issues. Oct 3, 2022 · For more information about user device affinity, see Link users and devices with user device affinity. Overview These additions mean that this version gives the user the possibility to perform the following actions, without the need of access to and/ or a locally installed ConfigMgr console: Fill in a Computer name. I have seen many SCCM admins asking for WQL queries for different scenarios. TopConsoleUser, which is the user who has been logged in the most on the device. UniqueUserName [UserName] See full list on learn. UserGroupName = "Domain\\AD_Group") However when I try to save the query rule Configuration Manager says that the query is not valid. Scripts, reports, and tools for Instead of deploying applications to all the user's devices, you deploy the application to the user and Configuration Manager automatically installs the application on all devices that are associated with that user. I will share it here for anyone else looking for this: select SMS_R_SYSTEM. The WMI class names closely correlate to the SQL view names. v_UsersPrimaryMachines. What you are looking for it's either a Query, SQL report or even a powershell to list all the primary users for your device. Manufacturer0 as [Manufacturer], comp. Types = 1 order by SMS_G_System_COMPUTER_SYSTEM. Any help would be great. Client0 from v_R_System as VRS inner join v_FullCollectionMembership as FCM on VRS. Name0, v_R_User. But to exclude some devices that they will also have gained affinity with. Nov 28, 2023 · this query so working, but when add softweare metering list dont give result declare @DeviceCollectionID nvarchar; SELECT SYS. Apr 6, 2015 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Aug 15, 2024 · When you enter the SQL Server WQL query while creating the collection, there is a run option that instantly checks the devices that match the criteria. Sep 3, 2014 · We have set the PXE server to “Allow user device affinity with automatic approval”, and have set the task sequence variables “SMSTSAssignUsersMode” to Auto and “SMSTSUdaUsers” to the desired AD account as outlined in Method #1 (“Set the value to \ and the task sequence will configure the specified user as the primary user for the Hello everyone. Console Apps (16) My Active Work Items. v_R_User. 168. The assigned individual users need to be Hello, on Assets & Conformance = Devices, has the primary user column . FullUserName, SMS_R_User. Action Log Notify. SerialNumber0 as [Serial Number], comp. (manage-bde -protectors -get c:) then Use SQL management studio to connect to the database : then Can i get a WQL/SQL query to get data of all devices offline more than & equal to 90 days, where the last online time is more than & equal to 90 days. Either you can let ConfigMgr take care of it or you can manually set the relationship between an user and a device. Our IT department would like to work with three different user collections per software package: [softwareName] - Installed [softwareN Jul 6, 2022 · User and Device Affinity. Provide details and share your research! But avoid …. What *might* work that is in the Database is v_r_system. Here is how the collection query language would look that shows the primary computers for the group DOMAIN\\GROUPNAME The client does not have it enabled in client settings, I told them to enable it. The following User and Device affinity settings are available in default client settings and Feb 25, 2016 · Hi Adam. The SCCM WQL queries are used in dynamic collections and automation tasks for SCCM/ConfigMgr, Using dynamic collections, you can add devices/users to a particular collection based on the criteria. You signed out in another tab or window. From what I can see its those that dont have a console user/top console user (not currently in the query below) From what we can tell anyway Any advice is greatly appreciated. I've dabbled in SQL enough to have a basic understanding of the language and how to manipulate the statements to my liking, but I don't possess the proficiency to understand what tables should be using (hence the Googling and just looking for the most convenient hits I could find on SQL querying missing patches which led me to this) Hi Folks, Today we will check how to run sccm query on sql. I believe you can pipe the device affinity object to Add-CMDeviceCollectionDirectMembershipRule. Delete Aged User Device Affinity Data; CSCareerQuestions protests in solidarity with the developers who make third party reddit apps. You don’t need to Jul 12, 2018 · But I wanted a SQL query for the same to run it on a SCCM database, export the data to excel so that I can search the user from the report. You made one typo 'latestuser. resourceID inner join v_Collection as Col on fcm. User_Name0 [UserName], SD. The four main discovery views are v_R_System for system resources, v_R_User for user resources, v_R_UserGroup for user group resources, and v_R_UnknownSystem for unknown systems. IPAddresses, SMS_R_System. Highlight all of the clients with no BG copy and paste into excel, add headers, done. UserGroupName, SMS_R_User. This view can be joined to other views by using the MachineResourceID Jun 24, 2024 · SCCM Client InActive Obsolete Status Using SQL Query | ConfigMgr – Table 1 SQL Query – SCCM Client InActive Obsolete Status. I came across this TechNet post which describes a SQL query to find the collection information. If not you can use get-cmdevice to get the resource ID. sql at master · stelmer/ConfigMgrUserDeviceAffinity Nov 21, 2024 · Introduction. Nov 9, 2021 · Hello, I largely tried to avoid user-based deployments in favor of device-based deployments, but I am trying to get the deployment status of an application that is deployed to a user-based collection. User_Name0 = v_R_User. ResourceId INNER JOIN SMS_R_User ON SMS_G_System_SYSTEM_CONSOLE_USAGE Dec 29, 2020 · We could also use SQL query to check the machine information: {Select sv. U. UniqueUserName WHERE SMS_UserMachineRelationship. Also, try to find out how to install the Chrome browser using SCCM. Edited by Frederick Dicaire 14 hours 30 minutes ago This Device Collection is limited to the "All Systems" Device Collection. Also the results won’t be tied to the data. Sets a SQL Query type global condition in Configuration Manager. SecurityGroupName = 'Contoso\TestUsers') For more detailed information, please refer to: Creating Device Collections Based on Primary Users (and vice versa) SCCM 2012 buid computer collection based on user group membership / primary user Apr 30, 2014 · Name0 ChassisTypes0 Manufacturer0 Model0 Operating_System_Name_and0 User_Name0 UserResourceID Full_User_Name0 Is_Virtual_Machine0 TotalPhysicalMemory0 IP_Addresses0 SCCM-2K12 1 No Enclosure NULL Microsoft Windows NT Server 6. Thanks a lot for this nice way to combine multiple joins. UserName from SMS_R_User where SMS_R_User. This SQL Query will help you use the ‘IIF’ syntax and declare the states accordingly (In the last post, we used ‘When’ and ‘then’ syntax). The data would have to be manually aligned together. Scripts, reports, and tools for leveraging user device affinity in Configuration Manager - ConfigMgrUserDeviceAffinity/UDA Querys. I am however struggling with making this work. Every now and then, you will encounter a situation when you need to find which ConfigMgr Collection(s) a specific computer is a member of for troubleshooting purposes. select vru. Oct 20, 2017 · In your environment you may have Users that have multiple machines E. Let’s try to create a custom report to find Google Chrome versions installed on Windows 10 devices. ResourceID Join v_Collection COL on FCM. 15 WIN8-CLIENT1 1 No Enclosure NULL Microsoft Windows NT Workstation 6. Jun 27, 2023 · The SQL query can be used to pull out any information from SCCM and an admin familiar with SQL can even create complex queries. You can integrate user device affinity into PXE deployments, bootable media deployments, and pre-staged media deployments. Run the following query in SQL against the SMS Database: Gets a request for user device affinity in Configuration Manager. CollectionID = COL. Oct 3, 2022 · The Configuration Manager discovery views consist of system resource objects, which include any resources that were discovered on the network. User_Name0 AS 'User Name' ,v_R_System. Using SQL to directly modify the ConfigMgr DB is completely unsupported and may/will cause issues Jul 1, 2015 · The query rule: select * from SMS_R_System where SMS_R_System. Last_Logon_Timestamp0 as [Last Logon Timestamp], ops. In my testing I created a new AD group with my user and created a device collection with this WQL: Device affinity removes the need for Configuration Manager to determine the names of all the devices of a user before you deploy applications for that user. Let’s find out the SCCM client’s Active, Inactive, and obsolete Status. I have SMSTSAssignUsersMode = True and the boot media is set Aug 28, 2024 · SCCM Primary Last Logon User Report | SQL Query | ConfigMgr – Fig. Didn't know this. Console Licensing. NetBIOS_name0 [MachineName], sv. Name However I think though the direction is still not a good one. MachineID = vrs. Creation_Date0 but, that's a big MAYBE. There's also a canned report: Home > ConfigMgr_XXX > User - Device Affinity > User device affinity associations per collection Jul 11, 2018 · Yes, user to device affinity. PowerShell Activity. For User collection : Select * From SMS_R_User where UniqueUserName not in (Select UniqueUserName from SMS_UserMachineRelationship) For SQL Report: select vru. Console Tier Mapping. ResourceDomainORWorkgroup,SMS_R_SYSTEM. Share Sort by: I do not have the sql query for it, but if you can use it, i can show you have you can do it through PowerShell To use the script below you need: Have the PowerShell ActiveDirectory components installed Have the SCCM admin console installed Have the needed access in both AD and SCCM Change the first 4 variables to fit your setup Sorry could you elaborate further Still a bit of an sccm rookie. I'm not exactly sure what I'm doing wrong. Set User device affinity threshold (days) to a value of at least seven days. Add the column to either the devices view or whatever collection you’re using and sort by it. Cireson Control Center. For more information about user device affinity, see How to Manage User Device Affinity in Configuration Manager . Name0, A. For more information, see Link users and devices with user device affinity in Configuration Manager. Device affinity removes the need for Configuration Manager to determine the names of the devices of a user before you deploy Dec 21, 2020 · Please let me know a safe SQL query which can be used to delete UDA information SCCM Database . in a 2012 environment, you have user/device affinity. Device affinity removes the need for Configuration Manager to determine the names of the devices of a user before you deploy Apr 28, 2016 · Here is the SQL query needed for the dataset in Report Builder. Essentially, I'd like some input on the following: What constitutes a "bad" or "poorly written" query? Didn't notice this one until now. Since time logged into a device is the metric User and Device Affinity relies on, it should match your Primary User for a device, so you can use it to associate a user with a device in a WMI query. i. I can find the separately but, unable to combine the queries to run in sccm query. I worked with the below code to try to get results from a user-based deployment, but no The query works in SSMS because it’s a SQL query. Now, it’s time to find the SQL query for the SCCM Primary Last Logon user Report. LastLogonUserName in (select SMS_R_User. *if* that device only appears because of the initial heartbeat (you don't do system discovery from AD to ad I will try this SQL query and let you know if it works thanks. Just seems like WQL is a much better option than SQL. There are several methods by which you can integrate user device affinity into your OS deployments. UserName0 as [User Name], vrs. v_R_User as U . Unique_User_Name0, U. Jun 21, 2024 · Today, we will discuss the ConfigMgr Custom Report for Chrome Browser. SELECT Model0 AS Model, COUNT(*) AS Count FROM v_GS_COMPUTER_SYSTEM GROUP BY Model0 select [SQL Native Client 11. Find them by user account name or by SID. The query resulted in 95K entries. You can't have a collection that as device and users in it. The information collected includes the user name, device name, client type, number of logons, and time spent for each session. I know this violates a cardinal rule about avoiding LIKE with double-ended '%' wildcards, but hey. Questions : In 1 collection, yes. I have been asked to create a new report comprised of all laptops showing their primary user(s) and OS version. Best regards, Simon INNER JOIN SMS_R_User ON SMS_UserMachineRelationship. Nothing like this exists. In Configuration Manager, user device affinity defines a relationship between a user and a device. Mar 29, 2015 · Device Management: The user/device were tied together during enrollment. ResourceId = SMS_R_System. Cause we had many user changes and hw changes and still don't really have a hw lcm. com Get their primary devices: Get-CMUserDeviceAffinity. Unique_User_Name0 = v_UserMachineRelationship. In each SQL view, class and instance permission values are listed as a decimal value that is the result of converting bit fields reserved for each security right. Name0 Sometimes when I need to use PowerShell against SCCM and there are no native CM cmdlets to get the info I want or if its very complex, I just query the SCCM database directly. I do have access to the SQL database. Now we have decided to import the User-Device Affinity information manually using File. Open the SQL Management Studio. NetbiosName, SMS_R_System. User Centric. v_GS_SYSTEM_ENCLOSURE Recently I've been trying to create a report in SCCM to give me the following information; User Device Affinity (Hostname with the affinity associated) Computer make and model Department ( I figured we would just pull what OU this device is in for that) I've currently got a report to pull Just the UDA information in the format I like. blackberry, mcafee Posted by u/dverbern - 10 votes and 5 comments As an example, if you set User device affinity threshold (minutes) to 60 minutes and you set User device affinity threshold (days) to 5 days, the user must use the device for at least 60 minutes over a period of 5 days to automatically create a user device affinity. physicalDeliveryOfficeNam0 More details in: How to Add a User’s Office Location Details to a Report. Associate users with a computer - Configuration Manager | Microsoft Docs Sep 4, 2020 · (SELECT SMS_R_User. MachineResourceID = v_GS_COMPUTER Scripts, reports, and tools for leveraging user device affinity in Configuration Manager - stelmer/ConfigMgrUserDeviceAffinity. Working with a client where they have setup collection groups for their monthly ADRs. Distinguished_name0 ,umr. User device affinities are the relationships between a device and its primary users. This view can be joined to other views by using the MachineResourceID column. Oct 3, 2022 · Lists detailed information about user device relationships in the Configuration Manager site including the relationship ID, the user name, the device ID, the creation time and more. SQL Query find the system name with username: SELECT v_R_System. UserResourceID = dbo. So User A might be associated with Win10-A, but also because of terminal services sessions or citrix, with WIN2016-RDP1. Or re-work the query to specify a specific list of users. Let’s find the SCCM Application Deployment Status SQL Query Custom Report. I need to deploy software in an environment that does not use user collections for software deployment but I only have a list of computers. User_Domain0 [Account Domain], USR. UniqueUserName, SMS_R_System. CollectionID = col. Name0 [Computer Name], SD. Here is a simple query to return all Collections a specific computer is in. You can see this setting when you create custom client settings for both devices and users. Its really easy if you first build the WQL query in monitoring > queries to get the results you are looking for. This Jul 2, 2014 · How to configure the Primary device for a user. Jun 30, 2007 · Create a new report and paste the below query into it. The following steps will help you create a custom report to determine the status of the active, inactive, and obsolete Configuration Manager Jun 27, 2024 · SQL Query –SCCM Application Deployment Status. There are several ways that you can determine the primary device of a users. FUNCTION JBMURPHY-SCCM-GetComputerByLastLoggedOnUser You know how we can get a device's information by doing a WMI query for it like this for example in powershell : find-user-name-data-within-configuration-manager Because if you want to find the primary devices of users in a specific AD group, then you would have to make query the 'SecurityGroupName' or the 'UserGroupName' properties of an SMS_R_User instance. The 3 Defined Columns are: UserName CollectionName ComputerNames Jun 30, 2007 · Create a new report and paste the below query into it. It allows the administrators to associate a user with his primary devices. The correct way to deploy to devices, based on user attributes would be through User Device affinity. 2 NULL NULL NULL 1 4193780 192. Sep 22, 2024 · As an SCCM Admin, other than my daily dashboard, I honestly hardly ever run Reports for myself and instead I usually go straight to the source, the SQL DB! I find it faster and more flexible if I need to pull in additional data. The user can query a user from AD and select it to be a primary user. I need a help where I can get a SQL query to get the details of the last login username along with last login time Especially the last login username is required. Reading the Link users and devices with user device affinity in Configuration Manager, It says that " After Configuration Manager creates an automatic user device affinity, it continues to monitor the user device affinity thresholds. May 6, 2019 · If you already have AD security groups for any group of users, you can quickly create a SCCM collection containing the primary computers belonging to those users. UniqueUserName FROM SMS_R_User WHERE SMS_R_User. The v_r_system view is the “default” view of the SCCM database. Dec 8, 2016 · Find computers where a particular user has logged on at least once. User Device Affinity. A primary device is the typical daily work device of the user such as a workstation or laptop. in some environments, it is not uncommon for domain accounts to run as services on a workstation (e. May 22, 2017 · In order to create a collection based User Device Affinity relationships, you need to have two things: User Device Affinity assigned according to the link above (Either based on Client Settings or manual assignment) An Active Directory Security Group of user objects you wish to query against. Model0 as [Model], bios. Netbios_Name0 AS [Computer Name], dbo. Create a device collection ,limit to whatever collection you want and then add query rule ,paste the below query and click ok. Instead of deploying an application to a group of devices, you deploy an application to a user and Configuration Manager installs the application on all devices associated with the user. May 25, 2022 · For my example, I’ve run the query on the computer shown in the first screenshot. 7: Fast Install: The user/device were tied together temporarily to enable an on-demand install from the catalog if no UDA relationship installed before the Install was triggered. v_R_System. I run the query, type in "Domain\MrMrRubic" then get only once device returned. Here's an example that could get you started with:SQL Query: Find user’s primary device by Department AD attribute. v_UserMachineRelationship. select dbo. This SQL Query will display Users and their Primary computers (1 Row per User, which is achieved using the SQL Function Stuff). SELECT SYS. Here are some useful queries for System Center Configuration Manager that you can use to create collections. name0, v_R_User. WQL solves this problem better. Now, let’s find the SQL query that you can get from this conversion method. SerialNumber0 AS [Serial Number], dbo. "domain\smsadmin" which should give me every SCCM server shows nothing. Let’s help to analyze the Google Chrome browser installation using ConfigMgr. I had come with below SQL query for the same with the help of above query. I need the query to display the name of the software. Identifying using User Collection Jun 16, 2014 · Since time logged into a device is the metric User and Device Affinity relies on, it should match your Primary User for a device, so you can use it to associate a user with a device in a WMI query. Devices, software, user affinity, etc I will use that, and i will create my own queries in SCCM and use the SQL output to DirectQuery in PowerBI Thank you Updated: There was a question on myitform recently ,asking for Users (collection or SQL Report) without Device affinity set. Do I need to "Import User Device Affinity"? Should I be manually adding entries with a csv like that? Oct 5, 2015 · You can use powershell scirpt on sccm , so you can view user nae and computer at a same time Use the below script To before use, test script in test domain Following script to query SCCM for the “list of computer’s who’s last logged on user” is the person I am looking for. This join could be either by using primary user in user device affinity, or by using the Asset Intelligence tables for Console Usage and Console User (which you would have to turn on). If you want a collection that list Primary users of the device this is not possible. Members Online SQL server and drive I/O questions. Lists information about users and their primary devices in I utilized top console user as user device affinity does not seem reliable, or at least not currently for us. This query can be used to create Oct 9, 2022 · Much of the Configuration Manager SQL Server view schema maps to the SMS Provider WMI schema, which is used when building WQL-based queries and collections in the Configuration Manager console. AD_Site_Name0 as [Site] from v_GS_COMPUTER_SYSTEM comp inner join v_GS_OPERATING_SYSTEM ops on ops Configuration Manager (5) ConfigMan Ticker. This is a holdout from before SCCM but the team likes it and wants to keep it. Sep 30, 2021 · SQL Query to Find Co-Management Devices. Any subsequent Device Collections for that site would be limited to the "<SITE> Computers - All" Device Collection. some Users with Both a Laptop and a Desktop. Issue: If you are running a mixed environment with Lenovo Devices, you will notice that they do not store the model name in the model field. Below is the WQL query for creating the collection:(sorry about the formating) Jan 25, 2021 · dbo. 8: Exchange Server connector Will give you all devices + the User Device Affinity of the particular device, which you can then use Excel to filter. View Builder. Name0 as [Computer Name] from v_UsersPrimaryMachines upm left join v_R_User vru on upm. My SQL is a little rusty as I havent done much programming since That way, the user can log in and can immediately get its user deployed applications through Software Center. System Center Configuration Manager (SCCM) is a critical tool for managing devices, software, and users across an enterprise. RelationActive = 1 might be a key part to help with your duplicate lines. ResourceId in (select resourceid from SMS Ah, it makes it possible to set the device user affinity during OSD, if you set the SMSTSAssignUsersMode as a task sequence variable with the domain\user for the user/users that should be primary user for the device. Feb 13, 2019 · To find this data we found 2 working queries towards SCCM: $Query = " SELECT SMS_R_User. Looking for some help, need to run a report for devices with SSDs and HDDs but the model's aren't the same to make it easy to filter. Aug 22, 2023 · Hi all, I am struggling to combine these two queries so that I can get a list of computer models and the installed wireless driver on it. Connectors Jul 3, 2024 · The query for the same would be Latest Posts—SCCM Secondary Site Maintenance Tasks | List | ConfigMgr | SQL Query HTMD Blog. If you don't see any SQL servers in the query results, it means the query is incorrect or not working. Questions : At present we have enabled automatic User Device Affinity for 10000 machines in "Client Settings". in SQL it would be something like: select distinct v_R_System. G. CollectionID,Col. v_R_System LEFT JOIN dbo. I have found the following SQL report and then customized it to my needs. g. Version0 as [Version], vrs. ResourceID The problem is that if a computer have two or more primary users then I get two or more rows and I would like to only get one row for each computer and with one primary user it do not matter which of the primary users that's on that row. However, if you May 5, 2021 · The view only has two columns: MachineID for the computer, and UserResourceID for the user listed in SCCM. Instead of deploying applications to all the user's devices, you deploy the application to the user and Configuration Manager automatically installs the application on all devices that are associated with that user. Let's start with query about Windows 10 machines;Select distinct SMS_R_System. CollectionID where VRS. However, if you have manually defined relationships, you will need to manually manage collections. ResourceID,SMS_R_SYSTEM. v_R_User ON dbo. Jul 1, 2019 · Adding functionality, by introducing an option to add a User Device Affinity/ Primary User. Name0 as [Machine Name], comp. Name FROM SMS_R_System INNER JOIN SMS_G_System_SYSTEM_CONSOLE_USAGE ON SMS_G_System_SYSTEM_CONSOLE_USAGE. Yes, it’s doable but you can’t build queries for user affinity in the designer - try breaking it down and starting with a query for machines that have Installed Software = the app you’re interested in and a Display Version less that the version you need them to be, that’ll let you quickly run and evaluate the query. Group Assign. Jan 16, 2018 · I would like to write a query for a user collection in SCCM. UserName0 from V_GS_COMPUTER_SYSTEM A join v_FullCollectionMembership B on A. At present we have enabled automatic User Device Affinity for 10000 machines in "Client Settings". So, the database is getting what's discovered. Within SCCM, queries are built in WQL. I am able to run this query for devices and their drive models which I can sift through but how can I go about limiting it to a certain collection or at least give me a collection or computer model column to work with? Sep 29, 2021 · Let’s find out the easiest method to create SCCM WQL queries. 1 SQL Query – SCCM Primary Last Logon User Report. If the user's activity for the device falls below the thresholds you've set, the site removes the user device Feb 21, 2023 · After Configuration Manager creates an automatic user device affinity, it continues to monitor the user device affinity thresholds. May be bcoz multiple users using multiple machines. Asking for help, clarification, or responding to other answers. Netbios_Name0 as 'Computer Name',WS. At the very least, you should probably look at the top console user. Set-CMGlobalConditionWqlQuery: I got a reply from the Microsoft forums with the exact answer I was looking for. Does anyone have an idea of how to pull the Primary User for each device and put that into AD? My current path has me looking for a SQL query into a Powershell script, but I am open to other ideas if there is a better way. From there, you can join the V_R_SYSTEM view to other SCCM view and create creative reports based on your SCCM active directory attributes. Here's what I wrote in SSMS - You can modify the views to match WQL. Okay, hopefully the mobile client doesn’t ‘fix’ this too much - this is part of a query to look at machines with Project and their associated UDA (I’ve chopped out the piece that looks at the metering rule as it’s not relevant for now); v_UserMachineRelationship. I love building SQL queries as much as the next guy but just not needed in this case. LastLogonUserName, SMS_R_System. SMSUniqueIdentifier,SMS_R_SYSTEM. Name,SMS_R_SYSTEM. description0 AS 'description' FROM v_R_System INNER JOIN v_R_User ON v_R_System. Where it looks like it is defined or not. You can also create the inverse for any of these. Unique_User_Name0, v_GS_COMPUTER_SYSTEM. 2 (Tablet It seems the below query isnt capturing all systems in the collection and seems to leave some out. I could even join devices to user data with powershell from SCCM and AD but it makes it inconvenient. ResourceID, vru. Things I've tried so far: - Created a custom Powershell script with a GUI that will show during the TS. May 22, 2012 · You might want to open up the report's SQL code, figure out which ConfigMgr SQL views it's referencing, and then translate that to the SCCM WMI class names. 0][SQL Server]Conversion failed when converting the nvarchar value 'SomeDomain\SomeUsername' to data type int. User_Name0 Oct 9, 2022 · Security views can be used to query for Configuration Manager class or instance permissions for secured objects. Fill in a MAC Address. I know SCCM builds up user-device affinity over a period of sustained usage of a device by a user. Note: If like me, your Users list was empty or included only user groups, v_UsersPrimaryMachines will be empty, even if you assigned Primary Users from the SCCM Console’s “Devices” screen. select distinct v_GS_COMPUTER_SYSTEM. ResourceID Security views can be used to query for Configuration Manager class or instance permissions for secured objects. If the user's activity for the device falls below the thresholds you've set, the site removes the user device affinity. Thanks. ResourceType,SMS_R_SYSTEM. Select A. It's just not feeding into Users. Please let me know a safe SQL query which can be used to delete UDA information SCCM Database . reddit's new API changes kill third party apps that offer accessibility features, mod tools, and other features not found in the first party app. There is a status message for it but status messages age out. CollectionID Join v_R_User USR Apr 25, 2024 · Excellent list, would like to have a query that combines user device affinity using display name, make and model of the hardware, and includes the last policy cycle of the device. You would need to convert the query or rebuild it (this isn’t the most difficult since the ending of the table name is almost always the same in the WQL query builder). During OSD the tech enters the primary user for the machine, which populates SMSTSUDAUsers. "; I'm not deadset on making these things happen, because of course SCCM maintains user-device affinity itself over time based on frequency of a user logging into a given machine. This means that many reports in SCCM do not show the correct information for Lenovo devices which can be frustrating. Notify Analyst. ADSiteName, SMS_G_System So sccm doesn't directly interact with asset, but does downstream. This is all available data in the V_R_SYSTEM view. User device affinity is a new feature in System Center 2012 Configuration Manager. User_Name0 [Last Logon User Name], dbo. Name0 AS 'System Name' ,v_R_System. Corona kicked us in the ass, cause we didn't have an cmg at that time and our user don't really use VPN often, if anytime. Name0 The result is a mismatch -- in my case 36 users matching with 64 primary devices. For example, if you want to find all primary devices of users that are member of the CONTOSO\Accounting group: May 21, 2018 · Select comp. 6: OSD: The user/device were tied together as part of OSD imaging. The other thing to be weary of is in sccm, your users fields, what format is that stored in? mine for example is corp\username in device affinity, but last logged on user is stored at username@domain ,which doesn't map to any field inside my instance. They also don't use device affinity. The description field in SCCM matches the data from Active Directory. Caption0 as [Operating System], prod. Preview Panes. So log in to the machine and get the ID / password and it should match what you got in the database. Name0 as [User Name], vrs. UserResourceID = vru. If you want to let ConfigMgr determine the relationship, this will have to be enabled in the Client Jun 16, 2014 · WMI does contain SMS_G_system_SYSTEM_CONSOLE_USAGE. Connect your Database Engine. I'm trying to leverage UDA to get a collection of machines that are specific to an AD group of users. Add those devices to another collection if desired Add-CMDeviceCollectionDirectMembershipRule. Is it possible to somehow limit my query further to try and get the device that the user has spent the most time on, or the most time on recently? Hello @sccm team . Full_User_Name0 as [Full Name] from v_R_User vru So possibly an easy one for you SCCM guys but dose anyone know how I can generate a list of machines for a speficed user as device affinity does here: I basicaly just want to generate the 'Devices of this user in the last 90 days' list along with the time stamp & number of logins. Client from SMS_R_System where SMS_R_System. e. This information can be used by user device affinity to create automatic affinities. The below SQL query can be used to pull the details of all devices along with Device type (Laptop, Desktop , Mini PC & Surface devices) directly from Configuration Manager database. :-) right? you’re thinking to yourself… self, this already exists natively in configmgr, why am i reading this blog post? let me try to answer that. Problem is their local IT do not always remember to place their endpoints into the collection groups. 91. Follow the steps mentioned below. etc. . The statement that I currently have shows Resource ID, Resource type, Name, Config manager Unique ID, Resource domain or workgroup, client and resource names. UniqueUserName = SMS_R_User. Change the colleciton id to match the collection you want. resourceID' instead of 'latest_user. By doing this I will get the list of machines which are not showing the last logon usern and will then work with my AD team to match with their reports. I would like to create a query the same way, appearing all devices, showing the primary and blank user has not defined. That's the date that record for that device first appeared in the database. /* All Collections for a specific Device I am trying to find a way to see all devices where users have logged into more than one device, is there a query that I can create to show this Share Add a Comment Sort by: You signed in with another tab or window. Today someone asked me to create one SQL query to get the machine details like hostname, IP Address, RAM, total HDD size, Free Space, Manufacturer, Model, Last Heartbeat, Users name, email ID, Last logged on user name. A device can be associated to more than one user, and a user can . Tier Watcher. Name0 AS 'ComputerName', I don't think you have to worry about user affinity as Bitlocker has to do with the device not the user. lazwtnu wsruzx zrlwyqof pcwmycl lscdp geat ixex pqiuzvv wspgf bjtf