Weekly Tip 57

PowerShell Script to Get Whether Deployments are Device or User-Based

Here’s a PowerShell script that will pull whether deployments are device based or user based. Insert your a location to save a CSV file, your primary site server name, and site code at the top.

$csv = <path to CSV file>

$siteServer = <site server name>

$siteCode = <site code>

$deployments = get-wmiobject -computername $siteServer -namespace root\sms\site_$siteCode -class SMS_DeploymentInfo

$collections = get-wmiobject -computername $siteServer -namespace root\sms\site_$siteCode -class SMS_Collection

add-content $csv “DeploymentName,CollectionID,CollectionType,CollectionName”

ForEach ($deployment in $deployments) {

$deploymentName = $deployment.DeploymentName

$collID = $deployment.CollectionID

$collName = $deployment.CollectionName

$collectionType = ($collections | where-object -filterscript {$_.CollectionID -eq $collID}).CollectionType

If ($collectionType -eq “0”) {$f_collectiontype = “Other”}

If ($collectionType -eq “1”) {$f_collectiontype = “User”}

If ($collectionType -eq “2”) {$f_collectiontype = “Device”}

add-content $csv “$deploymentname,$collID,$f_collectionType,$collName”

}

Share:

Facebook
Twitter
LinkedIn

Contact Us

=
On Key

More Posts

WME Security Briefing 27 May 2024

Kinsing Hacker Group Exploits Docker Vulnerabilities Overview Recent investigations have shown that the hacker group Kinsing is actively exploiting Docker vulnerabilities to gain unauthorized access to systems. The modified hacker group targets misconfigured Docker API ports deployed with cryptocurrency mining malware.

Read More »
WME Cybersecurity Briefings No. 010
Cyber Security

WME Security Briefing 20 May 2024

Advanced Persistent Threats: North Korean Hackers Launch Golang Malware Overview A new malware strain, called Titan Stealer, is currently actively circulating in the threat landscape, targeting a variety of personal data and linked to North Korean state-sponsored cyber espionage

Read More »
WME Cybersecurity Briefings No. 009
Cyber Security

WME Security Briefing 08 May 2024

Exploitable vulnerability in Microsoft Internet Explorer, used to deploy VBA Malware Overview Cybersecurity researchers discovered a severe exploitation targeting a bug that had already been patched in the Microsoft Internet Explorer browser. Their report added that

Read More »
Be assured of everything

Get WME Services

Stay ahead of the competition with our Professional IT offerings.

=