Go directly to the SQL database instead of going thru ConfigMgr. it will have a lot less overhead. https://askgarth.com/blog/how-to-use-powershell-to-query-sql-database/
Connecting to System Center Configuration Manager (SCCM) using PowerShell from outside the SCCM server.
Hello everyone,
I am seeking assistance in connecting to the System Center Configuration Manager (SCCM) using PowerShell from a remote machine. My primary objective is to establish a connection to the SCCM's database. (I wanted to work on some query part). I am looking for a step-by-step procedure on how to achieve this, including the necessary privileges, roles, and permissions required for this task.
Could anyone kindly provide a detailed document or guide that outlines the complete process of connecting to the SCCM server and its database using PowerShell from an external machine? It would be greatly appreciated if the document covers the following aspects:
Prerequisites for establishing a remote connection to SCCM's database.
Required PowerShell modules or cmdlets for connecting to the SCCM server and executing queries against its database.
Recommended roles and permissions for the user account used to establish the connection.
Any additional considerations or best practices to ensure a successful connection and query execution.
I look forward to any assistance or guidance that the community can provide. Thank you in advance for your support.
Best regards,
Swahela Mulla
2 answers
Sort by: Most helpful
-
-
Youssef Saad 3,411 Reputation points
2023-06-06T07:53:09.96+00:00 Hello Swahela Mulla,
You can connect trough PowerShell using the CM cmdlets, but before, you have to import the related module. You will find in the following articles the steps:
- Connecting to SCCM Using PowerShell
- Get started with Configuration Manager cmdlets
- ConfigMgr PS commands
To connect to your CMDB, you have to install SQL Server Management Studio then connect remotely to the DB and do your SQL queries. For more details:
Make sure that TCP port 1433 is enabled between your remote machine which has SSMS within your ConfigMgr database server.
Regards,
Youssef Saad | Blog: https://youssef-saad.blogspot.com/ | LinkedIn