SCCM Client Approved N/A - Best SQL Command that will Auto Approve all Clients

This is a good day! I have managed to fix a thing that has been a big problem at some SCCM 2007 customers. Clients are getting Approved N/A status even if everything looks ok and should work.

SCCM-New-SQL-Command-Approved-NA

I have seen big complicated scripts that will change the status but today I found the most powerful and simple way to fix it.

First, go to your SCCM site where the clients are and create a new SQL Command.

Auto-Approve-All-SCCM-Clients

Name:
ApproveAllClients

SQL command:
UPDATE v_CM_RES_COLL_SMS00001
SET IsApproved=1
FROM v_CM_RES_COLL_SMS00001
INNER JOIN v_R_System
ON v_CM_RES_COLL_SMS00001.ResourceID = v_R_System.ResourceID
WHERE v_CM_RES_COLL_SMS00001.IsApproved<>1

Log status to:
\c$\temp\ApproveAllClients.log">\\<siteserver>\c$\temp\ApproveAllClients.log

I found this solution at MyItforum so thank you sooo much!! Link:
http://myitforum.com/myitforumwp/2011/11/10/configmgr-auto-approve-clients-the-easy-way/

SCCM Client Approved N/A - Best SQL Command that will Auto Approve all Clients

This is a good day! I have managed to fix a thing that has been a big problem at some SCCM 2007 customers. Clients are getting Approved N/A status even if everything looks ok and should work.

SCCM-New-SQL-Command-Approved-NA

I have seen big complicated scripts that will change the status but today I found the most powerful and simple way to fix it.

First, go to your SCCM site where the clients are and create a new SQL Command.

Auto-Approve-All-SCCM-Clients

Name:
ApproveAllClients

SQL command:
UPDATE v_CM_RES_COLL_SMS00001
SET IsApproved=1
FROM v_CM_RES_COLL_SMS00001
INNER JOIN v_R_System
ON v_CM_RES_COLL_SMS00001.ResourceID = v_R_System.ResourceID
WHERE v_CM_RES_COLL_SMS00001.IsApproved<>1

Log status to:
\\<siteserver>\c$\temp\ApproveAllClients.log

I found this solution at MyItforum so thank you sooo much!! Link:
http://myitforum.com/myitforumwp/2011/11/10/configmgr-auto-approve-clients-the-easy-way/

Check CCMEXEC service State / Startmode with WMIC script

Sometimes you want to see which servers are running the SMS Agent Service and which ones has the service disabled.

Create a CMD file with this line (one line):

wmic /node:@CCMEXEC.txt /output:CCMEXEC.csv Service where name="CcmExec" Get Name,State,Startmode /format:csv

Put the hostnames into CCMEXEC.txt, one hosname on each line

Run the CMD as Admin and the output will be saved into a nice CCMEXEC.CSV