Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Script msg-ing list of PCs fails on some

$
0
0

Hi, I'm using PowerShell from my Microsoft System Center Configuration Manager server (SCCM) to message a group of machines via pop-up. The following script works except for the machines that are powered off...and others...for some reason.

$ComputerList=Get-WmiObject-ComputerNameSCCMSERVERNAME-Namespace"ROOT\SMS\site_XXX"-Query"SELECT * FROM SMS_FullCollectionMembership WHERE CollectionID='XXXXXXXX' order by name"|selectName

 

ForEach

 

 

 

($ComputerObjectIn$ComputerList){

icm

 

 

-computername$ComputerObject.Name -scriptblock {msg*"This is a test. Click OK."}

}

There are 110 computers in the collection. The script works perfectly with a smaller collection, say 5 PCs. But when I Try a larger one, some boxes don't display the pop-up. And these boxes work perfectly when I use a smaller collection (and the same script). Is there a limitation here I'm unaware of? Any thoughts? Advice?


Viewing all articles
Browse latest Browse all 6937

Trending Articles