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 Cybersecurity Briefings No. 006
Cyber Security

WME Security Briefing 22 April 2024

Critical Update on FISA Section 702 Reauthorization Overview The expiration date of Section 702 of the Foreign Intelligence Surveillance Act (FISA) is near. So, Congress is looking to reauthorize crucial US spy programs. The provision is

Read More »
WME Cybersecurity Briefings No. 005
Cyber Security

WME Security Briefing 15 April 2024

E-Commerce Security Alert: Unveiling Magecart’s Persistent Backdoor Overview Malicious activities by Magecart attackers have been reported. They are targeting Shopify’s content delivery network (CDN) by creating fake Shopify stores. The backdoor method has enabled them to

Read More »
WME Cybersecurity Briefings No. 004
Cyber Security

WME Security Briefing 11 April 2024

Mispadu Trojan Exploits Windows Vulnerability to Target Financial Data Overview The Mispadu banking trojan has intensified its operations as it’s exploiting an already patched Windows SmartScreen flaw. Since its initial identification in 2019, Mispadu has primarily preyed on

Read More »
Be assured of everything

Get WME Services

Stay ahead of the competition with our Professional IT offerings.

=