Hello, i am quite new in scripting.
i have an script in powershell to read from MECM (SCCM), based on
$Variable = Get-CMSoftwareUpdateDeployment -CollectionName $CollectionName | Where-Object { $_.ApplicationName -eq $ADR }
Adr is an Automaticdeploymentrule for windowsupdates.
I can filter and create an customobject, based on the resulting $Variable.
But how to filter Hostnames, which are in Status “Unknown” “Process” and “Error”?
Thanks for your support
Eddie
eddie,
Welcome to the forum. ![]()
Before we start … When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance
Guide to Posting Code - Redux <---- Click
![]()
( !! Sometimes the preformatted text button hides behind the settings gear symbol.
)
I wonder that you get something in return at all. I don’t get a property ApplicationName when I run Get-CMSoftwareUpdateDeployment. ![]()
Hello Olaf, thanks for the reply
you need the module ConfigurationManager, and need to connect your powershell session to the sms site. All cmd-lets for configuratiomanager needs to be done under location of the sms_site
I know all that. ![]()
What I mean is that the return object I get when I run Get-CMSoftwareUpdateDeployment does not have a property ApplicationName.
Sorry, you need an parameter -summary
</>$Variable = Get-CMSoftwareUpdateDeployment -CollectionName $CollectionName -Summary | Where-Object { $_.ApplicationName -eq $ADR }
![]()
OK, that returns the property. ![]()
Since I never needed a query like this so far I googled it and found this:
Thanks i will go through, the part with
</>Get-CMDeploymentStatusDetails with the deployment summary object
looks promising, i will give it an try
Thanks a lot, this works exactly how it need it. Why didn’t i find this article on my search ![]()
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.