Categories: Uncategorized

All collections for specific machine

A bit of code from MyITForum.com with a report that lists all collections for a specific machine.

http://www.myitforum.com/forums/All_Collections_for_a_specific_computer/m_163312/tm.htm

select FCM.SiteCode as 'SMS Site', 
FCM.CollectionID, 
COL.Name as 'Collection' 
from v_R_System SYS 
join v_FullCollectionMembership FCM on FCM.ResourceID = SYS.ResourceID 
join v_Collection COL on COL.CollectionID = FCM.CollectionID 
where SYS.Name0 = @Computer

Prompt Query:

begin 
if (@__filterwildcard = '') 
SELECT DISTINCT SYS.Netbios_Name0 from v_R_System SYS WHERE SYS.Client0=1 ORDER By SYS.Netbios_Name0 
else 
SELECT DISTINCT SYS.Netbios_Name0 from v_R_System SYS WHERE SYS.Client0=1 
and SYS.Netbios_Name0 like @__filterwildcard 
ORDER By SYS.Netbios_Name0 
end
TomLasswell

Share
Published by
TomLasswell
Tags: sms2003

Recent Posts

Autotask: PowerShell: Enable Client Portal for all users

This is a quick one, it's been forever since I've posted here. After moving back…

2 years ago

PowerShell :: Get Exchange Mailboxes Over XXGB

Simple command turned crazy. I ended up coming up with this due to the fact…

3 years ago

PowerShell: ConnectWise Documents API, Uploading a document or attachment to a ticket

Phew, this one took a minute to figure out. ConnectWise has a form based documents…

5 years ago

PowerShell: ConnectWise REST API Query Contacts by Email Address

I've found myself at a new job, recreating many of the processes that I spent…

5 years ago

First post in a long time — changing hosting providers

Wow, it's been a while since I've done a real post on this site. I've…

6 years ago

Powershell: AutoTask – Get Picklist Values

When using AutoTask's API it's required to lookup a various amount of picklist values that…

9 years ago