Basic MECM Powershell Commands
Basic MECM Powershell Commands
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 1.Below Command Displays Site Server Name, SiteCode And Site Version
Get-CMSite | Select ServerName, SiteCode, Version
# 7. Below Command Displays the list of Boundaries and their value in MECM
Get-CMBoundary | Select DisplayName, Value
# 9. Below Command Displays the list of Compliance Baseline Name and its compliance
result in MECM
Get-CMBaseline | Select LocalizedDisplayName, ComplianceCount, NonComplianceCount
# 10. Below Command Displays the list of All deployments made in MECM
Get-CMDeployment | Select ApplicationName, CollectionName, DeploymentTime
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 1. Define Variables
$collectiondir = "C:\Users\sccmadmin\Desktop\Kashif"
$collectionname = "All Windows 10 Computes"
$Query = "select * from SMS_R_System where
SMS_R_System.OperatingSystemNameandVersion like '%workstation%'"
#Uninstall Java :
$app = Get-WmiObject -Class win32_Product | Where-Object {$_.Name -eq "Java 8
Update 221 (64-bit)"}
$app.uninstall()
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#5. Deployment
New-CMApplicationDeployment -CollectionName $collname -Name $appname -DeployAction
Install -DeployPurpose Available -UserNotification DisplayAll -AvailableDateTime
(Get-Date) -TimeBaseOn LocalTime -Verbose
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++